-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Which package is this bug report for?
voice
Issue description
For some reason, audioPlayer.stop() seems to cause the node process to never exit when called after destroying voice connection(s?) or not letting the event loop run for a bit before destroying voice connection(s?).
When ran in a debugger and pressing pause after the "cleanup" code has run, it will pause somewhere inside DataStore, and inspecting the variables shows that the AudioPlayer does not get removed from the list of active AudioPlayers even though stop() was called.
After seeing some setTimeout and setIntervals, I guessed that stopping audio player and destroying a voice connection back-to-back might cause issues, so by putting a sleep in-between, it does solve the problem and no longer hangs after "cleanup". It does look like a workaround so it should be fixed or at the very least be documented somewhere.
Code sample
// Please see the zip file for complete reproducible sampleVersions
@discordjs/voicev0.18.0discord.jsv14.21.0- Node v24.2.0
- Typescript v5.8.3
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
No Partials
Which gateway intents are you subscribing to?
GuildVoiceStates
I have tested this issue on a development release
No response