Example on how to disconnect a bot from a voice channel after it is done with playing audio? #7223
Unanswered
FlyingThunder
asked this question in
Q&A
Replies: 2 comments
-
found a solution, hopefully itll work long time: from asyncio import sleep
while voice_client.is_playing():
await sleep(1)
await voice_client.disconnect() |
Beta Was this translation helpful? Give feedback.
0 replies
-
Just use the after kwarg of vc.play. https://discordpy.readthedocs.io/en/stable/api.html#discord.VoiceClient.play |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Ive been looking for a clear example of that for a while.
So far, ive been using that:
but with time this lagged my bot very hard while playing audio.
I couldnt find a more efficient way of checking that, examples very appreciated
Beta Was this translation helpful? Give feedback.
All reactions