- 39
- 7
Как исправить это?
bot discord:
import discord
import json
from discord.ext import commands
file = open('config.json', 'r')
config = json.load(file)
bot = commands.Bot(command_prefix=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\cawa1\Desktop\Discord Bot\main.py", line 9, in <module>
bot = commands.Bot(command_prefix=config['prefix'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BotBase.__init__() missing 1 required keyword-only argument: 'intents'
File "C:\Users\cawa1\Desktop\Discord Bot\main.py", line 9, in <module>
bot = commands.Bot(command_prefix=config['prefix'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BotBase.__init__() missing 1 required keyword-only argument: 'intents'