Discord机器人帮助命令[discord.py]

时间:2020-09-14 10:10:29

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

我在机器人上设置帮助命令时遇到问题。我已经从中删除了默认的帮助命令

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

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

1 个答案:

答案 0 :(得分:1)

很奇怪,但是重新生成机器人令牌是可行的。