0

введите сюда описание изображения

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 ответ 1

1

Вам необходимо добавить в строку intents:

bot = commands.Bot(command_prefix=config['prefix'], intents=discord.Intents.all())

Так же включить Intents на сайте. Пример здесь.

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.