1
0
Fork 0
mirror of synced 2024-06-23 08:40:41 +12:00

Added an extra exception for when failing to move channels

This commit is contained in:
Phxntxm 2016-10-14 19:48:00 -05:00
parent 4a46b0d8c7
commit 96489aa850

View file

@ -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)