【问题标题】:Discord bot help command [discord.py]Discord 机器人帮助命令 [discord.py]
【发布时间】:2021-01-01 01:18:08
【问题描述】:

我在我的机器人上设置帮助命令时遇到问题。我已经从

中删除了默认的帮助命令
bot.remove_command("help")

然后使用此代码设置我的自定义帮助:

@bot.command(aliases=['h'])
async def help(ctx):
    await ctx.send('play <songname>' or 'p <songname>' --> Play a song)
    await ctx.send('pause' or 'pp' --> Pause the song)
    await ctx.send('resume' or 'pr' --> Resume the song)
    await ctx.send('looptrack' or 'lt' --> Loops the current song - beta)
    await ctx.send('dc' --> disconnect me from the voice channel)

但是,我现在将代码更改为:

@bot.command(aliases=['h'])
async def help(ctx):
    await ctx.send("nothing here")

现在当用户输入帮助或 `h 时,输出如下:

nothing here
'play <songname>' or 'p <songname>' --> Play a song
'pause' or 'pp' --> Pause the song
'resume' or 'pr' --> Resume the song
'looptrack' or 'lt' --> Loops the current song - beta
'dc' --> disconnect me from the voice channe

即使从我的帮助功能中删除旧帮助,我也不知道为什么会打印旧帮助。

【问题讨论】:

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


    【解决方案1】:

    很奇怪,但重新生成机器人令牌有效。

    【讨论】:

      猜你喜欢
      • 2018-05-06
      • 1970-01-01
      • 1970-01-01
      • 2020-11-06
      • 2021-09-16
      • 2018-05-31
      • 2021-10-06
      • 2021-08-14
      • 2019-12-14
      相关资源
      最近更新 更多