discord-webhook2

Crates.iodiscord-webhook2
lib.rsdiscord-webhook2
version0.4.1
sourcesrc
created_at2024-07-10 10:11:40.82634
updated_at2024-10-10 11:00:51.529558
descriptionDiscord webhook library
homepage
repositoryhttps://github.com/theaddonn/discord-webhook2
max_upload_size
id1298083
size102,850
Lucy (theaddonn)

documentation

README

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!

Commit count: 102

cargo fmt