diff --git a/Music-Bot.py b/Music-Bot.py index f75a2e1..1ab8668 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -203,7 +203,9 @@ else: ctx.voice_client.play( player, after=lambda e: print(f"Player error: {e}") if e else None ) - + while ctx.is_playing(): + await asyncio.sleep(1) + await ctx.disconnect() await ctx.respond(f"{success}Now playing: `{player.title}`\nRequested by {ctx.author.mention}") @@ -261,15 +263,6 @@ else: elif ctx.voice_client.is_playing(): ctx.voice_client.stop() - @bot.event - async def on_voice_state_update(ctx: commands.Context): - while True: - await asyncio.sleep(1) - if ctx.voice_client.is_playing() and not ctx.voice_client.is_paused(): - pass - else: - await ctx.voice_client.disconnect() -