A
A
Artem Shirkalin2021-07-20 11:35:34
Python
Artem Shirkalin, 2021-07-20 11:35:34

What to do if the bot does not start?

What should I do, I start the bot and it gives an error
code

import discord
from discord.ext import commands
from config import settings

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


@bot.command() # Не передаём аргумент pass_context, так как он был нужен в старых версиях.
async def help(ctx):
  embed=discord.Embed(title="HELP MOD", description="Помощь новым модератором", color=0xff0000)
  embed.add_field(name="ban ", value="забанить", inline=True)
  embed.add_field(name="mute", value="замутить", inline=True)
  embed.add_field(name="kick", value="выгнать", inline=True)
  embed.add_field(name="vmute", value="замутить в голосовом канале", inline=False)
  embed.set_footer(text=" {member.name} ")
  await ctx.send(embed=embed)


@bot.event
async def on_ready():
    print('Logged in as:\n{0.user.name}\n{0.user.id}'.format(bot))

bot.run(settings['token'])

mistake
Traceback (most recent call last):
  File "C:\Users\79082\Desktop\bot-discord-js-py\bot\bot.py", line 9, in <module>
    async def help(ctx):
  File "C:\Python39\lib\site-packages\discord\ext\commands\core.py", line 1263, in decorator
    self.add_command(result)
  File "C:\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.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
proqmain, 2021-07-20
@proqmain

after bot = ... add this: This code will remove the original built-in help command from the bot
bot.remove_command("help")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question