【问题标题】:The code keeps on trowing an error ```The command help is already an existing command or alias``` Why is this so and how do I fix it?代码不断抛出错误```命令帮助已经是现有命令或别名```为什么会这样,我该如何解决?
【发布时间】:2021-04-28 07:11:15
【问题描述】:

我正在使用 python 开发一个不和谐的机器人,但一旦我运行代码,它就会显示错误 The command help is already an existing command or alias.,并且它不在代码中的其他任何地方。

这里是代码

async def help(ctx):
  embed = discord.Embed(title='Help', description='Use s!help <command> for more info on it')
  embed.add_field(name="Moderation", value="Kick, Ban, Mute, Purge/Clean")
  embed.add_field(name="Roleplay", value="Hug, Kiss, Slap, Shoot, Punch, lick, poke, cookies")
  embed.add_field(name="Games", value='Dice, Slots,')
  embed.add_field(name="Extras", value='Weather, Ping')

【问题讨论】:

    标签: python discord.py discord.py-rewrite


    【解决方案1】:

    help 命令已经存在,所以你需要remove 覆盖它的默认命令:

    bot = commands.Bot(command_prefix='your prefix')
    bot.remove_command('help')
    
    #Your code
    
    bot.run(token)
    

    【讨论】:

      猜你喜欢
      • 2021-03-23
      • 2021-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多