#[non_exhaustive]pub struct Embed {Show 15 fields
pub title: Option<CompactString>,
pub kind: Option<EmbedType>,
pub description: Option<CompactString>,
pub url: Option<CompactString>,
pub timestamp: Option<Timestamp>,
pub color: Option<u32>,
pub footer: Option<Box<EmbedFooter>>,
pub image: Option<Box<EmbedImage>>,
pub thumbnail: Option<Box<EmbedImage>>,
pub video: Option<Box<EmbedVideo>>,
pub provider: Option<Box<EmbedProvider>>,
pub author: Option<Box<EmbedAuthor>>,
pub fields: Vec<EmbedField>,
pub components: Vec<Component>,
pub flags: Option<EmbedFlags>,
}Expand description
An embed: a rich content block (link previews, images, videos, or a bot’s custom “rich” embed).
Every part is optional. Sub-objects are boxed so an embed without them stays small (D-054).
Discord’s limits
apply when sending: title 256 characters, description 4096, up to 25 fields (name 256,
value 1024), footer text 2048, author name 256, and 6000 characters across all embeds of a
message. Building and validating embeds is the job of djs-builders.
discord.js counterpart: Embed (received) / EmbedBuilder (sent).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.title: Option<CompactString>The title.
kind: Option<EmbedType>The kind of embed (always EmbedType::Rich for embeds sent by bots and webhooks).
description: Option<CompactString>The description.
url: Option<CompactString>The URL the title links to.
timestamp: Option<Timestamp>The timestamp shown in the footer.
color: Option<u32>The color of the left border, as an RGB integer.
The footer.
image: Option<Box<EmbedImage>>The large image.
thumbnail: Option<Box<EmbedImage>>The small image in the top-right corner.
video: Option<Box<EmbedVideo>>The video (only set by Discord, never sent by bots).
provider: Option<Box<EmbedProvider>>The provider (only set by Discord, e.g. “YouTube”).
The author shown above the title.
fields: Vec<EmbedField>The fields (max 25).
components: Vec<Component>The components of a component embed
(EmbedType::Components): link buttons, sections and containers.
flags: Option<EmbedFlags>The embed’s flags.