Discord bot帮助命令

时间:2017-11-22 18:25:30

标签: python bots discord

当人们使用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命令中添加一个描述。我究竟会在哪里以及如何做到这一点?

2 个答案:

答案 0 :(得分:1)

@client.command(description="Some ping command") #here
async def ping(*args):
    await client.say(":ping_pong: Pong!")

答案 1 :(得分:0)

@client.command()
async def ping(*args):
    "here"
    await client.say(":ping_pong: Pong!")
相关问题