From 502911be8135696659da94bb5a0669260a57362c Mon Sep 17 00:00:00 2001 From: Milka64 Date: Sun, 13 Dec 2020 16:20:48 +0100 Subject: [PATCH] check if voice enabled #41 --- kabot/kabot/kabot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index b3cfbfa..4be50ef 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -92,7 +92,8 @@ class Mybot(commands.Cog): @commands.command() async def disconnect(self, ctx): - await ctx.guild.voice_client.disconnect() + if ctx.voice_client.is_connected(): + await ctx.guild.voice_client.disconnect() @commands.command(help="Interrogation issues \n Args: list, search[mot clé] et add[nom de l'issue]") async def issue(self, ctx, *args):