#discord

discord-message

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

1 unstable release

0.1.0 Jul 22, 2021

#126 in #discord

Download history 344/week @ 2024-07-25 277/week @ 2024-08-01 271/week @ 2024-08-08 315/week @ 2024-08-15 340/week @ 2024-08-22 245/week @ 2024-08-29 418/week @ 2024-09-05 399/week @ 2024-09-12 363/week @ 2024-09-19 268/week @ 2024-09-26 342/week @ 2024-10-03 1383/week @ 2024-10-10 1441/week @ 2024-10-17 1505/week @ 2024-10-24 889/week @ 2024-10-31 920/week @ 2024-11-07

5,066 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.5–4MB
~69K SLoC