Open dongmaster opened 4 years ago
Let's see if we can reproduce this after #87 is fixed...
I've done some changes to my own fork of Alchemy to see if this issue has been fixed. See this commit for what I changed (it's not much): https://github.com/dongmaster/alchemy/commit/e5fc09541d085fbb03cdd060db2adcbdf5db986c
I'll make a pull request in a few days when I see that the change has fixed it. You could also implement the changes yourself if you want to fix it earlier.
Sorry for possibly confusing title.
If you let a bot be connected to a voice channel without doing anything in there for quite a few hours (+12 hours possibly), then eventually, the connection to the voice gateway will be terminated for some reason or the other, such as the connection being closed, timing out, or receiving a 503 error code. Example: 07:24:13.970 [debug] Voice Gateway for guild_id disconnected, reason: {:remote, :closed}
https://github.com/cronokirby/alchemy/blob/master/lib/Voice/gateway.ex#L78-L85 This ondisconnect handler doesn't seem to properly handle this scenario, and causes the bot to fall into a sort of "limbo" where you can make the bot join different voice channels, but there's no real connection to the voice gateway anymore, thus resulting in not being able to play any audio in the voice channel. In this limbo state, the bot is visibly connected to a voice channel in the discord client.
How to reproduce the problem: