[][src]Crate twilight_embed_builder

twilight-embed-builder

discord badge github badge license badge rust badge

twilight-embed-builder is a set of builder for the twilight-rs ecosystem to create a message embed, useful when creating or updating messages.

Examples

Build a simple embed:

use twilight_embed_builder::{EmbedBuilder, EmbedFieldBuilder};

let embed = EmbedBuilder::new()
    .description("Here's a list of reasons why Twilight is the best pony:")?
    .field(EmbedFieldBuilder::new("Wings", "She has wings.")?.inline())
    .field(EmbedFieldBuilder::new("Horn", "She can do magic, and she's really good at it.")?.inline())
    .build();

Build an embed with an image:

use twilight_embed_builder::{EmbedBuilder, ImageSource};

let embed = EmbedBuilder::new()
    .description("Here's a cool image of Twilight Sparkle")?
    .image(ImageSource::attachment("bestpony.png")?)
    .build();

Re-exports

pub use self::author::EmbedAuthorBuilder;
pub use self::author::EmbedAuthorNameError;
pub use self::builder::EmbedBuildError;
pub use self::builder::EmbedBuilder;
pub use self::builder::EmbedColorError;
pub use self::builder::EmbedDescriptionError;
pub use self::builder::EmbedTitleError;
pub use self::field::EmbedFieldBuilder;
pub use self::field::EmbedFieldError;
pub use self::footer::EmbedFooterBuilder;
pub use self::footer::EmbedFooterTextError;
pub use self::image_source::ImageSource;
pub use self::image_source::ImageSourceAttachmentError;
pub use self::image_source::ImageSourceUrlError;

Modules

author

Create embed authors.

builder

Create embeds.

field

Create embed fields.

footer

Create embed footers.

image_source

Sources to image URLs and attachments.