Skip to content

Struct command::object::Embed

zaun_community_protocol::command::object::Embed · Struct

pub struct Embed { … }

An embed. Every text is optional, but an embed shows something: a title, a description, an author, a footer, a picture or a field (color, timestamp and url alone do not count).

1–256 scalars.

1–4 096 scalars.

The title’s link: https:// only, ≤ 2 048 bytes, no whitespace or control characters. Needs a title.

0x000000–0xFFFFFF.

A time the embed shows, ms since the epoch (< 2^53).

The author line.

The footer line.

The large picture: one of the message’s attachments.

The small picture: one of the message’s attachments.

Up to 25 fields, in order.

pub fn attachments(&self) -> impl Iterator<Item = (&'static str, AttachmentId)> + '_

The attachments this embed shows, with the field that names each: embeds.image, embeds.thumbnail, embeds.author.icon, embeds.footer.icon.

pub fn is_empty(&self) -> bool

Whether the embed shows nothing but a colour, a time or a bare link.

Clone, Debug, Default, Deserialize<'de>, Eq, PartialEq, Serialize, StructuralPartialEq

Full rustdoc page