0

При запуске бота в дискорде выдаёт ошибку File "C:\Users\Dima\Desktop\Новая папка (20)\main.py", line 16, in async def help(ctx): File "C:\Users\Dima\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 1263, in decorator self.add_command(result) File "C:\Users\Dima\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 1149, in add_command raise CommandRegistrationError(command.name) discord.ext.commands.errors.CommandRegistrationError: The command help is already an existing command or alias.

import discord
from discord.ext import commands

config = {
'token': 'TOKEN',
'prefix': '>',
'free': '1059502827447267338',
'vip': '1059503060235329617',
'prem': '1059503066354827355',
'adm': '1059503076542787585'
}  

bot = commands.Bot(command_prefix=config['prefix'])

@bot.command()
async def help(ctx):
embed=discord.Embed(title="🎁 | Attack")
embed.add_field(name=">free", value=" - бесплатная атака", inline=True)
embed.add_field(name=">vip", value=" - вип атака", inline=True)
embed.add_field(name=">premium", value=" - премиум атака", inline=True)
embed.add_field(name=">admin", value=" - админ атака", inline=True)
embed.add_field(name=">methods", value=" - список методов", inline=True)
embed.add_field(name=">protocols", value=" - список протоколов", inline=True)
await ctx.send(embed=embed)

1 ответ 1

0

Ваш код выдает ошибку т.к. по умолчанию в Discord уже встроена команда help. Вам необходимо удалить её написав после

bot = commands.Bot(command_prefix=config['prefix'])

Строку:

bot.remove_command("help")

Ваш ответ

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

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