Tomato6966 / erela.js

An up to date Lavalink Wrapper, which makes it easy to use Lavalink within your Discord Bot!
Apache License 2.0
50 stars 25 forks source link

Bot on disconnect doesn't destroy the player #8

Closed CASPERg267 closed 1 year ago

CASPERg267 commented 1 year ago

Steps to reproduce

For example i have a player (bot) in the vc if you disconnect the bot it will act as it still in the voice channel and if you see the player channel is brings null instead of channel id

Tomato6966 commented 1 year ago

you have to handle that yourself.

client.on("voiceStateUpdate", (oldState, newState) => { if(oldState.channelId && !newState.channelId) client.musicManager.players.get(newState.guildId)?.destroy?.(); })

CASPERg267 commented 1 year ago

Ooh completely forgot about this issue, i solved it already but the reason i opened an issue because it wasn't a bug at original erela.js