I had a working bot with threads that send an embed when they receive data from a socket connection. So when it receives data, a background task is created that at the end will send the embed. But it somehow stopped working. The only change to my bot was updating discord.py to 1.5.0.
Reproduction Steps
No real reproduction steps. It happened I think just after updating discord.py. I tried downgrading to 1.4.2 but I get the same RuntimeError.
Expected Results
To work as normal.
Actual Results
Exception in thread Thread-523:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/theo/Esport-notifier/env/lib/python3.8/site-packages/socketio/client.py", line 616, in _handle_eio_message
self._handle_event(pkt.namespace, pkt.id, pkt.data)
File "/home/theo/Esport-notifier/env/lib/python3.8/site-packages/socketio/client.py", line 500, in _handle_event
r = self._trigger_event(data[0], namespace, *data[1:])
File "/home/theo/Esport-notifier/env/lib/python3.8/site-packages/socketio/client.py", line 550, in _trigger_event
return self.handlers[namespace][event](*args)
File "/home/theo/Esport-notifier/py/csgo/scorebot/scorebot.py", line 219, in log
self.on_event[event](event_data)
File "/home/theo/Esport-notifier/py/cogs/live_score.py", line 79, in on_round_end
self.send_embed.start()
File "/home/theo/Esport-notifier/env/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 191, in start
self.loop = asyncio.get_event_loop()
File "/usr/lib/python3.8/asyncio/events.py", line 639, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'Thread-523'.
Checklist
[x] I have searched the open issues for duplicates.
[x] I have shown the entire traceback, if possible.
[ ] I have removed my token from display, if visible.
[ ] I have provided the intents that my bot is using.
System Information
This is the system info from my PC but it currently runs on heroku and I get the same error.
Python v3.8.2-final
discord.py v1.5.0-final
aiohttp v3.6.2
system info: Linux 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020
Summary
I had a working bot with threads that send an embed when they receive data from a socket connection. So when it receives data, a background task is created that at the end will send the embed. But it somehow stopped working. The only change to my bot was updating discord.py to
1.5.0
.Reproduction Steps
No real reproduction steps. It happened I think just after updating discord.py. I tried downgrading to 1.4.2 but I get the same
RuntimeError
.Expected Results
To work as normal.
Actual Results
Checklist
System Information
This is the system info from my PC but it currently runs on heroku and I get the same error.