#How can I detect when a resource has finished playing?
6 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
(static) AudioPlayer.on()
stateChange event to Idle
Man, do I just don't know how to read the doc or it's just bad... it doesn't say a single thing about stateChange event on https://discord.js.org/#/docs/voice/main/class/AudioPlayer 🥲
for anyone used search to get here:
player.play(resource);
player.on('stateChange', (oldState, newState) => {
if (newState.status === 'idle') {
console.log('Finished playing!');
}
});