#discord #data-structures #bot #discord-message

discord-message

A crate containing the utilities needed to build Discord webhook messages from Rust

1 unstable release

0.1.0 Jul 22, 2021

#2216 in Web programming

Download history 645/week @ 2024-12-16 93/week @ 2024-12-23 137/week @ 2024-12-30 522/week @ 2025-01-06 384/week @ 2025-01-13 374/week @ 2025-01-20 718/week @ 2025-01-27 793/week @ 2025-02-03 564/week @ 2025-02-10 790/week @ 2025-02-17 864/week @ 2025-02-24 995/week @ 2025-03-03 271/week @ 2025-03-10 194/week @ 2025-03-17 211/week @ 2025-03-24 349/week @ 2025-03-31

1,025 downloads per month
Used in 3 crates

GPL-3.0 license

6KB
52 lines

discord-message

Crates.io Docs.rs

discord-message is a crate containing the utilities needed to build Discord webhook messages from Rust

Example message creation

fn main() {
    let message = DiscordMessage {
        username: Some("BotMan".to_string()),
        content: "Text message. Up to 2000 characters.".to_string(),
        embeds: vec![
            Embed {
                title: "Title".to_string(),
                description: "Text message. You can use Markdown here.".to_string(),
                ..Default::default()
            }
        ],
        ..Default::default()
    };
    let json = message.to_json().unwrap();
}

Dependencies

~2.3–3.5MB
~67K SLoC