Added auto-disconnect feature
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user