创建一个响应多个嵌入字段的不和谐机器人命令

时间:2021-01-27 17:33:11

标签: discord.py

我正在创建一个机器人命令,允许用户在服务器上创建漂亮的嵌入。

 @bot.command()
async def embed(ctx,title_str,text_str,url_str, feildname_list):
    my_embed=discord.Embed(title=title_str, url=url_str, description=text_str, color=0xFF5733)
    await ctx.send(embed=my_embed)

目前 feildname_list 未使用。 我想要做的是使用字段名列表中的名称创建一系列内联字段,其中包含一个升序整数。

像这样:

enter image description here

使用文档我找到了这个命令

add_field(*, name, value, inline=True)

有效 - 但感觉不雅。当我创建 my_embed- 时,感觉应该有一种方法将字段添加为关键字参数,但我在文档中看不到一个。有这种方法吗?

1 个答案:

答案 0 :(得分:2)

不,没有办法按照你的要求去做