Не могу отключить бота от голосового чата (discord)
Есть проблема с ботом, что при выполнении команды "leave" (см. ниже) бот не выходит из голосового чата. Первая команда работает стабильно, а вот вторая, при ее выполнении бот отписывает, что он вышел из голосового чата, но не делает этого
@bot.command(pass_context = True)
async def join(ctx):
if (ctx.author.voice):
channel = ctx.message.author.voice.channel
await channel.connect()
else:
await ctx.send("First, go to the voice chat")
@bot.command(pass_context = True)
async def leave(ctx):
if (ctx.voice_client):
await ctx.guild.voice_client.disconnect()
await ctx.send("I left the voice chat")
else:
await ctx.send("I am not in voice chat")```