Mail.ruПочтаМой МирОдноклассникиВКонтактеИгрыЗнакомстваНовостиКалендарьОблакоЗаметкиВсе проекты

Ошибка с Discord Ботом | Python / discord.py

Dwoker Pan Ученик (165), на голосовании 10 месяцев назад
КОД:
 import discord 
from discord.ext import commands

TOKEN = 'Секретик'
PREFIX = '?'
Intents = discord.Intents().all()

bot = commands.Bot(command_prefix=PREFIX, intents=Intents)

@bot.command()
async def test(ctx):
await ctx.reply("test")

bot.run(TOKEN)
Ошибка:

 [2024-05-27 09:28:51] [INFO    ] discord.client: logging in using static token 
Traceback (most recent call last):
File "C:\Users\Cawa\Desktop\DwokerBOT\main.py", line 14, in
bot.run(TOKEN)
File "C:\Users\Cawa\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 860, in run
asyncio.run(runner())
File "C:\Users\Cawa\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\Cawa\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Cawa\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Cawa\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 849, in runner
await self.start(token, reconnect=reconnect)
File "C:\Users\Cawa\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 778, in start
await self.connect(reconnect=reconnect)
File "C:\Users\Cawa\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 704, 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.

Process finished with exit code 1
Голосование за лучший ответ
Тихон Бурдаков Гуру (4009) 11 месяцев назад
ты включил интенты на странице discord developer portal бота?
Курятина Оракул (64479) 11 месяцев назад
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.
Похожие вопросы