Replies: 1 comment
-
You’re getting this error because asyncio.create_task() requires a running event loop, and you're likely calling it from a synchronous context. Instead, you should use: asyncio.run_coroutine_threadsafe(self.play_next(), self.bot.loop) This safely schedules the coroutine to run in the bot’s main event loop, even when you're outside of it (like in an after callback). |
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.
-
Traceback (most recent call last):
File "C:\Users\lucar\AppData\Roaming\Python\Python311\site-packages\discord\player.py", line 712, in _call_after
self.after(error)
File "K:\DjBoss\main.py", line 237, in after_playing
asyncio.create_task(self.play_next())
File "C:\Program Files\Python311\Lib\asyncio\tasks.py", line 381, in create_task
loop = events.get_running_loop()
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop
Please help
Beta Was this translation helpful? Give feedback.
All reactions