From 7ce9e5115536ed670e6c784d91890dd3f90f9171 Mon Sep 17 00:00:00 2001 From: Lukas Blacha Date: Wed, 8 Feb 2023 18:40:54 +0100 Subject: [PATCH] Added auto-disconnect feature --- Music-Bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Music-Bot.py b/Music-Bot.py index 1ab8668..64a0310 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -203,9 +203,9 @@ else: ctx.voice_client.play( player, after=lambda e: print(f"Player error: {e}") if e else None ) - while ctx.is_playing(): + while ctx.voice_client: await asyncio.sleep(1) - await ctx.disconnect() + await ctx.voice_client.disconnect() await ctx.respond(f"{success}Now playing: `{player.title}`\nRequested by {ctx.author.mention}")