Skip to content

Embed (Legacy)

Note

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


EmbedPart 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]] = field(default_factory=list) class-attribute instance-attribute

List of embed's fields.

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

Embed's footer.

to_dict

EXCEPTION to the "models contain no custom methods" rule for two reasons:

  1. to_dict already exists on all models via inheritance, so overriding it does not break the design model.

  2. Thumbnail (Component V2) and EmbedThumbnail (Embed-only) are extremely easy to confuse. This guard catches the mistake early and provides a clear, actionable error instead of allowing Discord to return an obscure 400 error.


EmbedAuthor dataclass

Bases: DataModel

Embed author parameters.

name: str instance-attribute

Name of the author.

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

URL of the author. http or attachment:// scheme.

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

URL of author's icon. http or attachment:// scheme.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss


EmbedThumbnail dataclass

Bases: DataModel

Embed thumbnail.

url: str instance-attribute

Thumbnail content. http or attachment:// scheme.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss


EmbedField dataclass

Bases: DataModel

Embed field.

name: str instance-attribute

Name of the field.

value: str instance-attribute

Value of the field.

inline: Optional[bool] = None class-attribute instance-attribute

Whether or not this field should display inline.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss


EmbedImage dataclass

Bases: DataModel

Embed image.

url: str instance-attribute

Image content. http or attachment:// scheme.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss


EmbedFooter dataclass

Bases: DataModel

Embed footer.

text: str instance-attribute

Footer text.

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

URL of the footer icon. http or attachment:// scheme.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss