Gods this thing is so rickety
This commit is contained in:
@@ -6,6 +6,7 @@ module.exports = class AudioQueue {
|
||||
this.api = api;
|
||||
this.queue = [];
|
||||
this.current = undefined;
|
||||
this.api.player.on(Voice.AudioPlayerStatus.Idle, this.handleStop.bind(this));
|
||||
}
|
||||
playNext() {
|
||||
if (this.queue.length == 0) {
|
||||
@@ -13,10 +14,8 @@ module.exports = class AudioQueue {
|
||||
return;
|
||||
}
|
||||
this.current = this.api.play(this.queue[0]);
|
||||
this.api.player.on(Voice.AudioPlayerStatus.Idle, this.handleStop.bind(this));
|
||||
}
|
||||
handleStop(current) {
|
||||
console.log(`Handling stop`);
|
||||
this.queue.shift();
|
||||
this.playNext();
|
||||
}
|
||||
|
Reference in New Issue
Block a user