【问题标题】:How to align fields in discord.py embedded messages如何对齐 discord.py 嵌入消息中的字段
【发布时间】:2019-12-04 08:59:49
【问题描述】:

我正在创建一个类似于 的嵌入式 discord.py 消息

每个字段的值都有一个由单词和一个新行组成的字符串,每个单词后面跟着一个新行。正如您所看到的,格式略有偏差,并且列不完全居中。我怎样才能做到这一点?

我的不和谐嵌入代码:

embed = displayembed('Live Match Data')
embed.add_field(name = 'Blue Team', value= a1, inline = True)
embed.add_field(name = 'Champion', value = a2, inline = True)
embed.add_field(name = 'Rank', value = a3, inline = True)

embed.add_field(name = 'Red Team ', value = b1, inline = True)
embed.add_field(name = 'Champion', value = b2, inline = True)
embed.add_field(name = 'Rank', value = b3, inline = True)

embed.set_footer(text = ctx.author.name, icon_url = ctx.author.avatar_url)

await ctx.send(embed = embed)

【问题讨论】:

  • 你不能,因为嵌入在格式方面非常有限,并且在每个设备/分辨率上呈现不同。

标签: python formatting discord discord.py


【解决方案1】:
embed = discord.Embed(title='Live Match Data')
embed.add_field(name = 'Blue Team', value= "Something", inline = True)
embed.add_field(name = 'Champion', value = "Something", inline = True)
embed.add_field(name = 'Rank', value = "Something", inline = True)

embed.add_field(name = 'Red Team ', value = "Something", inline = True)
embed.add_field(name = 'Champion', value = "Something", inline = True)
embed.add_field(name = 'Rank', value = "Something", inline = True)

embed.set_footer(text=ctx.author.name, icon_url = ctx.author.avatar_url)


await ctx.send(embed=embed)

【讨论】:

    猜你喜欢
    • 2020-03-17
    • 1970-01-01
    • 2021-07-25
    • 2019-01-12
    • 1970-01-01
    • 2021-02-13
    • 2020-09-08
    • 2023-01-13
    • 2019-09-14
    相关资源
    最近更新 更多