mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 06:33:18 +00:00
Update Streamer class
This commit is contained in:
parent
824d4042c1
commit
49475212a7
@ -14,12 +14,19 @@ module.exports = class {
|
||||
if(!client.stations) return;
|
||||
|
||||
client.stations.forEach(station => {
|
||||
const audioPlayer = createAudioPlayer();
|
||||
this.map.set(station.name, audioPlayer);
|
||||
let audioPlayer = this.map.get(station.name);
|
||||
if(!audioPlayer) {
|
||||
audioPlayer = createAudioPlayer();
|
||||
this.map.set(station.name, audioPlayer);
|
||||
}
|
||||
this.play(station);
|
||||
});
|
||||
}
|
||||
|
||||
refresh(client){
|
||||
this.init(client);
|
||||
}
|
||||
|
||||
play(station) {
|
||||
const audioPlayer = this.map.get(station.name);
|
||||
const url = station.stream[station.stream.default];
|
||||
|
Loading…
Reference in New Issue
Block a user