Added an extra exception for when failing to move channels
This commit is contained in:
parent
4a46b0d8c7
commit
96489aa850
1 changed files with 8 additions and 2 deletions
|
@ -205,6 +205,12 @@ class Music:
|
||||||
# move_channel needs to be used if we are already in a channel
|
# move_channel needs to be used if we are already in a channel
|
||||||
except discord.ClientException:
|
except discord.ClientException:
|
||||||
state = self.get_voice_state(ctx.message.server)
|
state = self.get_voice_state(ctx.message.server)
|
||||||
|
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 state.voice.move_to(channel)
|
||||||
await self.bot.say('Ready to play audio in ' + channel.name)
|
await self.bot.say('Ready to play audio in ' + channel.name)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue