diff --git a/Music-Bot.py b/Music-Bot.py index 039fd18..fc21203 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -203,9 +203,6 @@ else: ctx.voice_client.play( player, after=lambda e: print(f"Player error: {e}") if e else 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}") @@ -264,6 +261,11 @@ else: ctx.voice_client.stop() + @bot.event + async def on_voice_state_update(ctx: commands.Context): + ctx.voice_client.disconnect() + + @bot.event