jhonny
jhonny

Reputation: 31

Discord.py How can I get the content of a fields of a embed?

I want to get all the content of the fields, but I get only "Embed.Empty", even if the embed contains fields. What can I do?

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

Upvotes: 1

Views: 1655

Answers (1)

Konyer
Konyer

Reputation: 368

There is no .title and .description in discord.Embed.fields, however, there is .name and .value. You may want to look through the documentation of Embeds: discord.Embed

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

Upvotes: 2

Related Questions