я хз что делать всё настроил не работает DISCORD BOT
import discord
from discord.ext import commands
import random
from PIL import Image, ImageDraw
from io import BytesIO
intents = discord.Intents.default()
intents.message_content = True
client = commands.Bot(command_prefix='!', intents=intents)
async def draw(ctx, width: int = 500, height: int = 500, color: str = 'white'):
img = Image.new('RGB', (width, height), color)
paint = ImageDraw.Draw(img)
for i in range(random.randint(10, 20)):
x1, y1 = random.randint(0, width), random.randint(0, height)
x2, y2 = random.randint(0, width), random.randint(0, height)
paint.line((x1, y1, x2, y2), fill='black', width=3)
buffer = BytesIO()
img.save(buffer, format='PNG')
buffer.seek(0)
await ctx.send(file=discord.File(buffer, filename='drawing.png'))
client.run('тут мой токен')
ошибка:
client.run('MTA5MjUzMDg2NjY3NDIwODc4OQ.GTlIhj.UEFxov_gNvbUkugmpg2eaAOFx-dskw4Y8hnFog')
File "D:\Projects\Paint\lib\site-packages\discord\client.py", line 860, in run
asyncio.run(runner())
File "D:\Python\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\Python\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "D:\Projects\Paint\lib\site-packages\discord\client.py", line 849, in runner
await self.start(token, reconnect=reconnect)
File "D:\Projects\Paint\lib\site-packages\discord\client.py", line 778, in start
await self.connect(reconnect=reconnect)
File "D:\Projects\Paint\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.```
Источник: Stack Overflow на русском