#discord #data-structures #webhook #utilities #containing #messages #build

discord-message

一个包含从Rust构建Discord webhook消息所需实用工具的crate

1 个不稳定版本

0.1.0 2021年7月22日

#47#containing

Download history 37/week @ 2024-04-03 10/week @ 2024-04-10 20/week @ 2024-04-17 24/week @ 2024-04-24 18/week @ 2024-05-01 22/week @ 2024-05-08 28/week @ 2024-05-15 43/week @ 2024-05-22 25/week @ 2024-05-29 19/week @ 2024-06-05 12/week @ 2024-06-12 15/week @ 2024-06-19 30/week @ 2024-06-26 42/week @ 2024-07-03 65/week @ 2024-07-10 317/week @ 2024-07-17

456 每月下载次数
3 crate 中使用

GPL-3.0 许可证

6KB
52

discord-message

Crates.io Docs.rs

discord-message 是一个包含从Rust构建Discord webhook消息所需实用工具的crate

消息创建示例

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 是一个包含从Rust构建Discord webhook消息所需实用工具的crate。

消息创建示例

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();
}

依赖

~1.6–2.7MB
~79K SLoC