🐛 fix: Autoplay bug

This commit is contained in:
2024-08-18 14:41:51 +07:00
parent f5e6fe7557
commit 4bd13b6378
+6 -6
View File
@@ -257,13 +257,13 @@ export class DiscordMusicPlayerInstance {
this.discordPlayer.play(resource); this.discordPlayer.play(resource);
this.nekoPlayer.startCurrentStream(); this.nekoPlayer.startCurrentStream();
this.events.emit('playing', new PlayerPlayingEvent(this)); this.events.emit('playing', new PlayerPlayingEvent(this));
});
this.discordPlayer.on('stateChange', (oldState, newState) => { this.discordPlayer.on('stateChange', (oldState, newState) => {
console.log('State change', oldState.status, newState.status); console.log('State change', oldState.status, newState.status);
if (oldState.status === 'playing' && newState.status === 'idle') { if (oldState.status === 'playing' && newState.status === 'idle') {
this.nekoPlayer.endCurrentStream(); this.nekoPlayer.endCurrentStream();
} }
});
}); });
} }