Помогите в Python кодом для бота в Дискорд

Я программировал код для своего бота на дискорде, начал, всё сделал, написал код, и мне вывело сразу же ошибку:

[2023-12-09 15:32:42] [INFO    ] discord.client: logging in using static token
Traceback (most recent call last):
  File "C:\Users\PK\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py", line 860, in run
    asyncio.run(runner())
  File "C:\Users\PK\AppData\Local\Programs\Python\Python38-32\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\PK\AppData\Local\Programs\Python\Python38-32\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\Users\PK\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py", line 849, in runner
    await self.start(token, reconnect=reconnect)
  File "C:\Users\PK\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py", line 778, in start
    await self.connect(reconnect=reconnect)
  File "C:\Users\PK\AppData\Local\Programs\Python\Python38-32\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

Код:

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 привет(ctx):
   await ctx.reply('пока')


bot.run(TOKEN)

Помогите пожалуйста, что делать?


Ответы (1 шт):

Автор решения: Rxg3

Там же всё написано))

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

Нужно зайти на https://discord.com/developers/applications/ , потом зайти на вкладку Bots и включить нужные интенты (В данном случае Message Content Intent).Intents

→ Ссылка