#twilight #discord #discord-api

twilight-embed-builder

Create validated message embeds for the Twilight ecosystem

19 releases (11 breaking)

0.11.1 Jul 7, 2022
0.10.1 Mar 20, 2022
0.8.0 Dec 3, 2021
0.7.1 Oct 29, 2021
0.2.0 Oct 30, 2020

#2310 in Web programming

Download history 96/week @ 2023-12-07 9/week @ 2023-12-14 17/week @ 2023-12-21 17/week @ 2023-12-28 10/week @ 2024-01-04 3/week @ 2024-01-11 20/week @ 2024-01-18 3/week @ 2024-01-25 4/week @ 2024-02-15 25/week @ 2024-02-22 23/week @ 2024-02-29 3/week @ 2024-03-07

55 downloads per month
Used in twilight-convenience

ISC license

1.5MB
30K SLoC

twilight-embed-builder

codecov badge 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()?;

Dependencies

~1.7–2.6MB
~51K SLoC