From a16a1e3ad27b9c0a1c4b633d0cd4768ac874b2e2 Mon Sep 17 00:00:00 2001 From: Lukas Blacha Date: Wed, 8 Feb 2023 18:19:55 +0100 Subject: [PATCH] Added auto-disconnect feature --- Music-Bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Music-Bot.py b/Music-Bot.py index 12a6047..d2e5652 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -188,7 +188,7 @@ else: try: player = await YTDLSource.from_url(url, loop=bot.loop) ctx.voice_client.play( - player, after=await ctx.voice.disconnect()) + player, after=await ctx.voice_client.disconnect()) except discord.HTTPException as err: raise commands.CommandError(err) finally: @@ -200,7 +200,7 @@ else: async with ctx.typing(): player = await YTDLSource.from_url(url, loop=bot.loop, stream=True) ctx.voice_client.play( - player, after=await ctx.voice.disconnect()) + player, after=await ctx.voice_client.disconnect()) await ctx.respond(f"{success}Now playing: `{player.title}`\nRequested by {ctx.author.mention}") @@ -239,7 +239,7 @@ else: try: player = await YTDLSource.from_url(url, loop=bot.loop) ctx.voice_client.play( - player, after=await ctx.voice.disconnect()) + player, after=await ctx.voice_client.disconnect()) except discord.HTTPException as err: raise commands.CommandError(err) finally: