discord-message

Crates.iodiscord-message
lib.rsdiscord-message
version0.1.0
sourcesrc
created_at2021-07-22 16:02:04.306091
updated_at2021-07-22 16:02:04.306091
descriptionA crate containing the utilities needed to build Discord webhook messages from Rust
homepagehttps://github.com/ewpratten/discord-lambda/discord-message
repositoryhttps://github.com/ewpratten/discord-lambda
max_upload_size
id425950
size5,823
Evan Pratten (ewpratten)

documentation

https://docs.rs/discord-message

README

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();
}
Commit count: 8

cargo fmt