1 unstable release
0.1.0 | Jul 22, 2021 |
---|
#41 in #containing
1,302 downloads per month
Used in 3 crates
6KB
52 lines
discord-message
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
~1.7–2.9MB
~82K SLoC