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(),
..Default::default()
}
],
..Default::default()
};
let json = message.to_json().unwrap();
}
Structs§
- Discord
Message - The main message type
- Embed
- Describes an embed
- Embed
Author - Describes an embed author
- Embed
Field - Describes a field that can be used inside a message embed
- Embed
Footer - Describes an embed footer
- Embed
Image - Describes an embed image
- Embed
Thumbnail - Describes an embed thumbnail
- Error
- This type represents all possible errors that can occur when serializing or deserializing JSON data.