4 releases (2 breaking)

0.3.1 Aug 3, 2024
0.3.0 Jul 29, 2024
0.2.0 Jul 24, 2024
0.1.0 Jul 10, 2024

#568 in Network programming

Download history 70/week @ 2024-07-04 41/week @ 2024-07-11 59/week @ 2024-07-18 189/week @ 2024-07-25 156/week @ 2024-08-01 14/week @ 2024-08-08 3/week @ 2024-08-15

190 downloads per month

Apache-2.0

41KB
1K SLoC

discord-webhook2

Crates.io Version Crates.io Total Downloads Crates.io License

A Rust library to interact with advanced discord webhooks.

Why use this one over the others?

While there are multiple other libraries, most of them are either unmaintained or lack certain features...

Supports:

  • Embeds
  • Handling message ids
  • Uploading files/extra data
  • Sending, getting, editing and deleting messages
  • Polls
  • Emojis

Example

A basic "Hello World" using discord-webhook2:

use discord_webhook2::{DiscordWebhook, Message};

#[tokio::main]
async fn main() {
    let webhook = DiscordWebhook::new("discord webhook url").unwrap();

    webhook.send(&Message::new(|message| message
        .content("Hello World!")
    )).await.unwrap();
}

More examples can be found in the examples directory discord-webhook2/examples.

Contributing

Contributing is always appreciated. Feel free to create issues or open pull requests at any time.

If you like this project dont forget to leave a star on github!

Dependencies

~7–19MB
~265K SLoC