我正在用Python开发一个不和谐的机器人。当用户对特定命令调用help命令时,机器人会返回指定的命令--但不会对该命令进行任何描述(除了默认的帮助命令本身)。
例如:
User: e!help question
Bot: e!question [question...]但是已经定义了help命令的描述:
User: e!help help
Bot: e!help [commands...] | Shows this message.如何编辑命令的描述?
发布于 2017-12-18 22:34:57
可以在创建命令时使用brief和description将详细信息添加到help命令。请参阅下面的示例代码。
from discord.ext import commands
bot_prefix = '!'
client = commands.Bot(command_prefix=bot_prefix)
@client.command(brief='This is the brief description', description='This is the full description')
async def foo():
await client.say('bar')
client.run('TOKEN')使用!help将显示以下内容
No Category:
help Shows this message.
foo This is the brief description
Type !help command for more info on a command.
You can also type !help category for more info on a category.使用!help foo将显示以下内容
This is the full description
!foohttps://stackoverflow.com/questions/47859913
复制相似问题