#My discord bot keeps dropping out of voice, is there...

1 messages · Page 1 of 1 (latest)

tranquil steppe
#

My discord bot keeps randomly dropping out of voice, the bot itself does not disconnect, it only disconnects from the voice server. It then attempts to reconnect automatically but ends up with a exception Discord.Net.WebSocketClosedException: The server sent close 4006: "Session is no longer valid.

I guess losing connection is a normal thing sometimes, but is there a way i can catch this? Is there an event i can hook to that tells me when my bot loses connection to the voice channel, so that i can manually reconnect?

Thanks in advance!

tranquil steppe
#

I think i might have found what to hook onto, IVoiceChannel.ConnectAsync() returns an IAudioClient which has a IAudioClient.Disconnected delegate

tranquil steppe
#

Can confirm, that was the solution, tagging it as solved
I'm my own little rubber ducky kek