2017-12-17 8 views
1

私はPythonでDiscordボットを開発しています。ユーザが特定のコマンドでhelpコマンドを呼び出すと、ボットは指定されたコマンドを返しますが、そのコマンドの説明は返されません(デフォルトのhelpコマンド自体を除く)。例えばデフォルトのヘルプコマンドに表示されているようにDiscordボットコマンドの説明を編集するにはどうすればよいですか?

User: e!help question 
Bot: e!question [question...] 

しかしhelpコマンドの説明がすでに定義されました:

User: e!help help 
Bot: e!help [commands...] | Shows this message. 

どのように私は、コマンドの説明を編集しますか?

答えて

0

コマンドを作成するときに、briefdescriptionを使用すると、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') 

This is the full description 

!foo 
が表示されます !help fooを使用して

​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を使用します

関連する問題