M
M
MIKHAN_GO2021-10-01 17:21:40
Python
MIKHAN_GO, 2021-10-01 17:21:40

Why does an error occur when adding the intents parameter?

Why when adding intents parameter:

intents = discord.Intents.all()

client = commands.Bot(command_prefix = '/', intents=intents)

An error occurs:
Traceback (most recent call last):
  File "d:\code\github.com\MIKHANGO\newbot\bot.py", line 152, in <module>
    client.run(config.token)
  File "C:\Users\MIKHAN_GO\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 723, in run
    return future.result()
  File "C:\Users\MIKHAN_GO\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 702, in runner
    await self.start(*args, **kwargs)
  File "C:\Users\MIKHAN_GO\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 666, in start
    await self.connect(reconnect=reconnect)
  File "C:\Users\MIKHAN_GO\AppData\Local\Programs\Python\Python39\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: <function _ProactorBasePipeTransport.__del__ at 0x000001AF0A735B80>
Traceback (most recent call last):
  File "C:\Users\MIKHAN_GO\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\MIKHAN_GO\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\MIKHAN_GO\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
    self._check_closed()
  File "C:\Users\MIKHAN_GO\AppData\Local\Programs\Python\Python39\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

2 answer(s)
S
Sergey Gornostaev, 2021-10-01
@MIKHAN_GO

The text of the error clearly states what the problem is and what to do about 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.

T
TanderOFF, 2021-10-02
@TanderOFF

Maeby will help

intents = discord.Intents.default()
intents.members = True

client = commands.Bot(command_prefix=['.'], intents=discord.Intents.all())

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question