disagreement/docs/embeds.md

622 B

Embeds

Embed objects can be constructed piece by piece much like in discord.py. These helper methods return the embed instance so you can chain calls.

from disagreement.models import Embed

embed = (
    Embed()
    .set_author(name="Disagreement", url="https://example.com", icon_url="https://cdn.example.com/bot.png")
    .add_field(name="Info", value="Some details")
    .set_footer(text="Made with Disagreement")
    .set_image(url="https://cdn.example.com/image.png")
)

Call to_dict() to convert the embed back to a payload dictionary before sending:

payload = embed.to_dict()