Discord 机器人帮助命令

Posted

技术标签:

【中文标题】Discord 机器人帮助命令【英文标题】:Discord bot Help command 【发布时间】:2018-05-06 14:19:44 【问题描述】:

因此,当人们使用 discord.py 附带的帮助命令时,我正在尝试更改命令的描述。

但我似乎真的不知道如何或在何处放置此描述。

我也在尝试在帮助列表中创建不同的类别,例如音乐,但我真的不知道从哪里开始。

我对 python 很陌生,但我之前接触过其他编程语言

我的代码很长,但这是其中的一部分

client = commands.Bot(command_prefix=commands.when_mentioned_or('?'), 
description='Help List', pm_help = True)
client.add_cog(Music(client))

path = 'Blacklist.txt'

bl = open(path, 'r')

@client.event
async def on_ready():
    print('---------------------------------------------------------------------------------------')
    print('')
    print('Logged in as '+client.user.name+' (ID:'+client.user.id+') | Connected to '+str(len(client.servers))+' servers | Connected to '+str(len(set(client.get_all_members())))+' users')
    print('')
    print('---------------------------------------------------------------------------------------')
    print('')
    print('Current Discord.py Version:  | Current Python Version: '.format(discord.__version__, platform.python_version()))
    print('')
    print('---------------------------------------------------------------------------------------')

@client.command()
async def ping(*args):
    await client.say(":ping_pong: Pong!")

假设我想为 ping 命令添加描述。我究竟会在哪里以及如何做到这一点?

【问题讨论】:

【参考方案1】:
@client.command(description="Some ping command") #here
async def ping(*args):
    await client.say(":ping_pong: Pong!")

【讨论】:

【参考方案2】:
@client.command()
async def ping(*args):
    "here"
    await client.say(":ping_pong: Pong!")

【讨论】:

以上是关于Discord 机器人帮助命令的主要内容,如果未能解决你的问题,请参考以下文章

我想使用 discord.py 创建一个多页帮助命令

如何将 discord.py 帮助命令放入嵌入中?

discord bot帮助命令没有做任何事情

需要帮助使用 discord bot 命令分配变量

discord.js 说命令帮助 meeee

我需要帮助在 discord py 中创建 discord py temp 静音命令