#discord #data-structure

discord-message

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

1 unstable release

0.1.0 Jul 22, 2021

#2023 in Web programming

Download history 191/week @ 2023-05-19 186/week @ 2023-05-26 262/week @ 2023-06-02 111/week @ 2023-06-09 138/week @ 2023-06-16 260/week @ 2023-06-23 270/week @ 2023-06-30 380/week @ 2023-07-07 414/week @ 2023-07-14 387/week @ 2023-07-21 403/week @ 2023-07-28 328/week @ 2023-08-04 457/week @ 2023-08-11 415/week @ 2023-08-18 408/week @ 2023-08-25 243/week @ 2023-09-01

1,613 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();
}

lib.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.1–3MB
~94K SLoC