-
When executing the
part of the code:
|
Beta Was this translation helpful? Give feedback.
Answered by
dlchamp
Jan 6, 2024
Replies: 1 comment 3 replies
-
Try changing
either use the suggestion above or add a new import |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While it's not a direct answer to the problem but, why not use something like mafic with lavalink?
It simplifies this entire process and moves most of this into a separate service that handles the youtube (plus other services) stuff and provides your bot a stream that's ready to go also eliminates the use of requests (blocking) to hit Youtube API or dealing with threading and such.
But for your issue:
It's likely because vc.play() creates an
AudioPlayer(threading.Thread)
(which is also whereafter
is called) in a new thread which does not have an event loop. Threads + asyncio just make it more complicated when there is a very simple solution - see above.As for a solution:
Maybe something…