From e9354febc4ec513d9157c4f2e9f06d8be39c089a Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sun, 14 May 2017 14:18:32 -0500 Subject: [PATCH] Force disconnection if we're stuck between connection states --- cogs/music.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cogs/music.py b/cogs/music.py index 963e450..9eaf027 100644 --- a/cogs/music.py +++ b/cogs/music.py @@ -326,6 +326,12 @@ class Music: except asyncio.TimeoutError: await ctx.send("Sorry, but I couldn't connect right now! Please try again later") return False + except discord.ClientException: + if state.voice: + await state.voice.disconnect(force=True) + log.warning("Force cleared voice connection on guild {} after being stuck between connected/not connected".format(ctx.message.guild.id)) + await channel.connect() + @commands.command() @commands.guild_only()