【发布时间】:2020-10-27 01:42:45
【问题描述】:
我正在制作一个帮助命令,我想打印一个命令的参数名称。我有一个命令对象,我正在使用 command.params,但我不知道如何从中提取值
@client.command()
async def Help(ctx):
embed = Embed(title="Available Commands")
for command in client.commands:
params = command.params
print(params)
embed.add_field(name=f"{command.name}{command.params}", value=f"{command.brief}", inline=False)
await ctx.send(embed=embed)
目前返回:
OrderedDict=([('ctx', < Parameter "ctx" >), ('card', < Parameter "card" >)])
如何提取值?
【问题讨论】:
标签: python discord.py