Skip to content

Struct EmbedBuilder

zaun_bot::EmbedBuilder · Struct

pub struct EmbedBuilder(…)

Builds an Embed. Pictures are attachment ids of the same message.

pub fn new() -> Self

An empty embed; give it at least a title, description, field, author or footer.

pub fn title<impl Into<String>>(self, t: impl Into<String>) -> Self

Title (≤ 256).

pub fn description<impl Into<String>>(self, d: impl Into<String>) -> Self

Description (≤ 4 096).

pub fn url<impl Into<String>>(self, url: impl Into<String>) -> Self

The title’s https:// link.

pub fn color(self, rgb: u32) -> Self

Side colour, 0xRRGGBB.

pub fn timestamp(self, ms: u64) -> Self

Timestamp, ms since the epoch.

pub fn author<impl Into<String>>(self, name: impl Into<String>) -> Self

Author line.

pub fn footer<impl Into<String>>(self, text: impl Into<String>) -> Self

Footer text.

pub fn image<impl Into<Id>>(self, attachment: impl Into<Id>) -> Self

Large picture: an image attachment of the same message.

pub fn thumbnail<impl Into<Id>>(self, attachment: impl Into<Id>) -> Self

Small picture: an image attachment of the same message.

pub fn field<impl Into<String>, impl Into<String>>(self, name: impl Into<String>, value: impl Into<String>, inline: bool) -> Self

A field (≤ 25).

pub fn build(self) -> Embed

The finished embed.

Clone, Debug, Default, From<EmbedBuilder>

Full rustdoc page