L
L
L3gend2021-12-08 16:36:39
Python
L3gend, 2021-12-08 16:36:39

RuntimeError: Event loop is closed, what should I do?

Hello. I made a bot in python, but at startup I get such an error - RuntimeError: Event loop is closed.

Here is the log:
Traceback (most recent call last):
File "C:\Users\ARHITECT\Desktop\bot ds\discordbot.py", line 52, in
bot.run("NTU5NDE5MzIyMzk3NjIyMjc2.XJe11w.IW_pTvkskO9cesQiQIH8soVrF0w")
File "C: \Users\ARHITECT\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 723, in run
return future.result()
File "C:\Users\ARHITECT\AppData\ Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 702, in runner
await self.start(*args, **kwargs)
File "C:\Users\ARHITECT\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 666, in start
await self.connect(reconnect=reconnect)
File "C: \Users\ARHITECT\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 601, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
Exception ignored in:
Traceback (most recent call last):
File "C:\Users\ARHITECT\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\ARHITECT\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\ Users\ARHITECT\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 745, in call_soon
self._check_closed()
File "C:\Users\ARHITECT\AppData\Local\Programs\Python\ Python310\lib\asyncio\base_events.py", line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-12-08
@L3gend

Carefully read the traceback, it contains both the cause of the error and the recipe for correcting it:

Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question