【问题标题】:Discord.py How can I get the content of a fields of a embed?Discord.py 如何获取嵌入字段的内容?
【发布时间】:2020-04-10 07:36:14
【问题描述】:

我想获取字段的所有内容,但我只得到“Embed.Empty”,即使嵌入包含字段。我能做什么?

for emb in message.embeds:
        for field in emb.fields:
            print(field.title)
                print(field.description)

【问题讨论】:

  • 你有一个缩进错误。

标签: discord.py discord.py-rewrite


【解决方案1】:

discord.Embed.fields 中没有.title.description,但是有.name.value。您可能需要查看 Embeds 的文档:discord.Embed

for emb in message.embeds:
    for field in emb.fields:
        print(field.name)
        print(field.value)

【讨论】:

    猜你喜欢
    • 2021-02-18
    • 1970-01-01
    • 2021-04-09
    • 2019-01-12
    • 2019-12-04
    • 2021-02-20
    • 2018-01-16
    • 1970-01-01
    • 2023-01-08
    相关资源
    最近更新 更多