Top.Mail.Ru
Ответы
Аватар пользователя
Аватар пользователя
Аватар пользователя
Аватар пользователя
Программирование
+2

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

КОД:

1234567891011121314
 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) 

Ошибка:

123456789101112131415161718192021222324
 [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 <module> 
    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 
По дате
По рейтингу
Аватар пользователя
Оракул

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.