diff --git a/Music-Bot.py b/Music-Bot.py index 49c679a..6366942 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -241,8 +241,7 @@ else: try: player = await YTDLSource.from_url(url, loop=bot.loop) ctx.voice_client.play( - player, after=lambda e: print(f"Player error: {e}") if e else None - ) + player, after=await ctx.voice.disconnect()) except discord.HTTPException as err: raise commands.CommandError(err) finally: @@ -262,6 +261,7 @@ else: ctx.voice_client.stop() + @bot.event async def on_application_command_error(ctx, error): print(f"[on_application_command_error]\n{ctx.author}\n{error}")