Crate discord_message[][src]

Expand description

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(),
    let json = message.to_json().unwrap();


The main message type

Describes an embed

Describes an embed author

Describes a field that can be used inside a message embed

Describes an embed footer

Describes an embed image

Describes an embed thumbnail

This type represents all possible errors that can occur when serializing or deserializing JSON data.