Added auto-disconnect feature

This commit is contained in:
Lukas Blacha
2023-02-08 18:52:58 +01:00
parent f09d8e3e9c
commit daaa120594

View File

@@ -204,7 +204,10 @@ else:
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
) )
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}")
await ctx.voice_client.disconnect() while ctx.voice_client.is_playing():
asyncio.sleep(1)
else:
ctx.voice_client.disconnect()
@bot.slash_command(name="pause", description="Pauses the playback") @bot.slash_command(name="pause", description="Pauses the playback")