Skip to main content
EmbedBuilder is a builder pattern for creating ApiEmbed. The result is passed to MessagePayload::add_embed or MessagePayload::add_embed_builder.

Limits

build() panics if the total length of all text fields exceeds 6000 characters. All string fields are automatically truncated to their individual limit when set.

Creating

EmbedBuilder::new

Creates an empty builder.

EmbedBuilder::from_embed

Creates a builder from an existing ApiEmbed. Use to edit an already-built embed.

Methods

title

Sets the embed title. Truncated to 256 characters.

description

Sets the main text of the embed. Supports Markdown. Truncated to 4096 characters.

url

Makes the title a clickable link. Not displayed if title is not set.

color

Sets the embed accent color as an RGB integer. Example: 0x5865F2.

color_hex

Sets the color from a hex string. Accepts "#5865F2" and "5865F2" formats. If the string is invalid, the color is not changed.

color_rgb

Sets the color from R, G, B components.

timestamp

Sets a timestamp at the bottom of the embed. Accepts an ISO 8601 string ("2024-01-15T12:00:00Z").

author

Sets the author block at the top of the embed.
Sets the text and icon at the bottom of the embed. text is truncated to 2048 characters.

image

Sets a large image at the bottom of the embed.

thumbnail

Sets a small image in the top-right corner of the embed.

video

Sets an embedded video.

audio

Sets embedded audio (Fluxer-specific).

field

Adds a field to the embed.
Once the 25-field limit is reached, new fields are silently ignored - no panic.

build

Finalizes the builder and returns an ApiEmbed. Panics if the total length of all text fields exceeds 6000 characters.

ApiEmbed

The resulting structure from the fluxer_types crate.

Examples