簡體   English   中英

Discord bot 幫助命令

[英]Discord bot Help command

因此,當人們使用 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 命令添加描述。 我到底會在哪里做,怎么做?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM