Skip to content

Embed (Legacy)

Note

The following classes come from the discord.parts.embed module.


EmbedBuilder dataclass

Bases: DataModel

Represents the Embed portion of a message.

title: Optional[str] = None class-attribute instance-attribute

This embed's title.

description: Optional[str] = None class-attribute instance-attribute

This embed's description.

timestamp: Optional[str] = None class-attribute instance-attribute

Timestamp of when the embed was sent.

color: Optional[int] = None class-attribute instance-attribute

Embed's accent color.

author: Optional[_EmbedAuthor] = None class-attribute instance-attribute

Embed's author.

thumbnail: Optional[_EmbedThumbnail] = None class-attribute instance-attribute

Embed's thumbnail attachment.

image: Optional[_EmbedImage] = None class-attribute instance-attribute

Embed's image attachment.

fields: Optional[list[_EmbedField]] = None class-attribute instance-attribute

List of embed's fields.

footer: Optional[_EmbedFooter] = None class-attribute instance-attribute

Embed's footer.

set_color

Set this embed's color with a hex.

Parameters:

  • hex (str) –

    color as a hex code (format: #FFFFFF)

Returns:

set_user_author

Set this embed's author.

Parameters:

Returns:

set_image

Set this embed's image.

Parameters:

  • url (str) –

    attachment:// scheme or http(s) URL

Returns:

set_thumbnail

Set this embed's thumbnail.

Parameters:

  • url (str) –

    attachment:// scheme or http(s) URL

Returns:

Set this embed's footer.

Parameters:

  • text (str) –

    footer's text

  • icon_url (str, default: None ) –

    attachment:// scheme or http(s) URL.

Returns:

add_field

Add a field to this embed.

Parameters:

  • name (str) –

    field's title

  • value (str) –

    field's text

  • is_inline (bool, default: False ) –

    if this field should be inlined

Returns:

set_timestamp

Set this embed's timestamp.

Returns: