【发布时间】: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