From 96489aa85019572e2f3e824e5e038f8d81994ebe Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Fri, 14 Oct 2016 19:48:00 -0500 Subject: [PATCH] Added an extra exception for when failing to move channels --- cogs/playlist.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cogs/playlist.py b/cogs/playlist.py index 2de4cca..80e164f 100644 --- a/cogs/playlist.py +++ b/cogs/playlist.py @@ -205,8 +205,14 @@ class Music: # move_channel needs to be used if we are already in a channel except discord.ClientException: state = self.get_voice_state(ctx.message.server) - await state.voice.move_to(channel) - await self.bot.say('Ready to play audio in ' + channel.name) + if state.voice is None: + voice_channel = self.bot.voice_client_in(ctx.message.server) + if voice_channel is not None: + await voice_channel.disconnect() + await self.bot.say("Sorry but I failed to connect! Please try again") + else: + await state.voice.move_to(channel) + await self.bot.say('Ready to play audio in ' + channel.name) else: await self.bot.say('Ready to play audio in ' + channel.name)