Added auto-disconnect feature

This commit is contained in:
Lukas Blacha
2023-02-08 18:43:11 +01:00
parent 7ce9e51155
commit b2d843324d

View File

@@ -203,7 +203,7 @@ else:
ctx.voice_client.play( ctx.voice_client.play(
player, after=lambda e: print(f"Player error: {e}") if e else None player, after=lambda e: print(f"Player error: {e}") if e else None
) )
while ctx.voice_client: while ctx.voice_client is not None:
await asyncio.sleep(1) await asyncio.sleep(1)
await ctx.voice_client.disconnect() await ctx.voice_client.disconnect()
await ctx.respond(f"{success}Now playing: `{player.title}`\nRequested by {ctx.author.mention}") await ctx.respond(f"{success}Now playing: `{player.title}`\nRequested by {ctx.author.mention}")