Proper disposal of a PlayerSubscription, and AudioPlayer

Really stupid question here however, I need to know what the safe and proper way to do this is. Does calling .destroy() on a VoiceConnection dispose of the subscription and player properly? Is that something I should even worry about? I ask because I'm considering keeping track of subscriptions within a map since it has a reference to both the player and connection (useful for several things, especially the audio player reference) and primarily would like to know if that would cause problems.
5 Replies
d.js toolkit
d.js toolkit4mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
SICKNICKERONI
SICKNICKERONIOP4mo ago
thanks! i totally missed that thread while i was searching before asking. however, just to be clear, i'd like to see if you have the same understanding as me. from what i've read and seen in the source code: if i was to track just the subscription and perform cleanup properly (unsubscribing then destroying the connection then deleting the subscription from my map), i would leave no references which would mean the program would be free from leaks.
pat
pat4mo ago
no need to destroy the connection yourself but yea
SICKNICKERONI
SICKNICKERONIOP4mo ago
Cool! Thanks.
Want results from more Discord servers?
Add your server