Added auto-disconnect feature

This commit is contained in:
Lukas Blacha
2023-02-08 18:47:13 +01:00
parent 607752fd4f
commit 0f16af383b

View File

@@ -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