mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 09:53: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;
|
if(!client.stations) return;
|
||||||
|
|
||||||
client.stations.forEach(station => {
|
client.stations.forEach(station => {
|
||||||
const audioPlayer = createAudioPlayer();
|
let audioPlayer = this.map.get(station.name);
|
||||||
|
if(!audioPlayer) {
|
||||||
|
audioPlayer = createAudioPlayer();
|
||||||
this.map.set(station.name, audioPlayer);
|
this.map.set(station.name, audioPlayer);
|
||||||
|
}
|
||||||
this.play(station);
|
this.play(station);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refresh(client){
|
||||||
|
this.init(client);
|
||||||
|
}
|
||||||
|
|
||||||
play(station) {
|
play(station) {
|
||||||
const audioPlayer = this.map.get(station.name);
|
const audioPlayer = this.map.get(station.name);
|
||||||
const url = station.stream[station.stream.default];
|
const url = station.stream[station.stream.default];
|
||||||
|
Loading…
Reference in New Issue
Block a user