简体   繁体   English

如何将多个值添加到字段 discord.py

[英]How do I add multiple values to a field discord.py

Whenever I make a embed, the field can only contain one value.每当我进行嵌入时,该字段只能包含一个值。 Im trying to make the embed like this.我正在尝试像这样嵌入。 Flow music's help embed流音乐的帮助嵌入

I tried to use enter but it only appears in the code.我尝试使用 enter 但它只出现在代码中。

if message.content.startswith('embedtest'):
      embed=discord.Embed(title="Joe")
      embed.add_field(name="joe", value="**joe**-joe", inline=True)

This is the embed I was trying to change.这是我试图更改的嵌入。 Answer does not require to be the same embed, I just need an explanation for how to do it.答案不需要是相同的嵌入,我只需要解释如何做。

You can't make multiple values for one field, but you can just add multiple fields in one embed.您不能为一个字段创建多个值,但可以在一个嵌入中添加多个字段。 One way to do this is like this:一种方法是这样的:

YourEmbed = discord.Embed(title="Joe")
YourEmbed.add_field(name="joe3", value="joe1")
YourEmbed.add_field(name="joe4", value="joe2")

Note that the maximum number of fields on one embed is 25. Make sure to send the embed using ctx.send(embed=YourEmbed) .请注意,一个嵌入的最大字段数为 25。确保使用ctx.send(embed=YourEmbed)发送嵌入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM