MIKHAN_GO
@MIKHAN_GO

Почему возникает ошибка при добавлении параметра intents?

Почему при добавлении параметра intents:
intents = discord.Intents.all()

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

Возникает ошибка:
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
  • Вопрос задан
  • 1084 просмотра
Решения вопроса 1
sergey-gornostaev
@sergey-gornostaev
Седой и строгий
В тексте ошибки прямым текстом написано в чём проблема и что с ней делать:
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.
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 2
@TanderOFF
Мейби поможет
intents = discord.Intents.default()
intents.members = True

client = commands.Bot(command_prefix=['.'], intents=discord.Intents.all())
Ответ написан
Комментировать
@ShadowShow
Ты в discord developer portal не включил разрешения в Bot вкладке
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы