From 607752fd4fdd2398122cfea126bdb2eadd7597b6 Mon Sep 17 00:00:00 2001 From: Lukas Blacha Date: Wed, 8 Feb 2023 18:44:45 +0100 Subject: [PATCH] Added auto-disconnect feature --- Music-Bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Music-Bot.py b/Music-Bot.py index d211602..039fd18 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -203,7 +203,7 @@ else: ctx.voice_client.play( player, after=lambda e: print(f"Player error: {e}") if e else None ) - while ctx.voice_client is not None: + while ctx.voice_client.on_voice_state_update(): await asyncio.sleep(1) await ctx.voice_client.disconnect() await ctx.respond(f"{success}Now playing: `{player.title}`\nRequested by {ctx.author.mention}")