Пытаюсь создать бота на пайтон для дискорда
import discord
import json
from discord.ext import commands
file = open('config.json', 'r')
config = json.load(file)
bot = commands.Bot(config['prefix'])
@bot.command(name='ping')
async def ping (ctx):
await ctx.send(f'{ctx.author.mention}pong')
bot.run(config['token'])
Выдает такую ошибку: " Traceback (most recent call last): File "C:\Users\Алексей\Desktop\DISCORD_BOT\main.py", line 8, in bot = commands.Bot(config['prefix']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: BotBase.init() missing 1 required keyword-only argument: 'intents' "
Ответы (1 шт):
Автор решения: q r t s
→ Ссылка
Вам необходимо добавить в строку intents:
bot = commands.Bot(command_prefix=config['prefix'], intents=discord.Intents.all())
Так же включить Intents на сайте. Пример здесь.
