1 unstable release

3.0.0 Mar 7, 2022
0.1.0 Mar 7, 2022

#21 in #client-send

Download history 1/week @ 2024-11-13 3/week @ 2024-11-20 13/week @ 2024-11-27 17/week @ 2024-12-04 20/week @ 2024-12-11 4/week @ 2024-12-18 1/week @ 2024-12-25 2/week @ 2025-01-08 8/week @ 2025-01-15 3/week @ 2025-01-29 15/week @ 2025-02-05 6/week @ 2025-02-12 47/week @ 2025-02-19 12/week @ 2025-02-26

81 downloads per month
Used in 2 crates

MIT license

13KB
311 lines

webhook-rs

Discord Webhook API Wrapper

Crate Crate Docs

Example usage

For a full example, take a look at examples/example.rs.

let url: &str = "Webhook URL";
let client: WebhookClient = WebhookClient::new(URL);
client.send(|message| message
    .username("Thoo")
    .avatar_url(IMAGE_URL)
    .embed(|embed| embed
        .title("Webhook")
        .description("Hello, World!")
        .footer("Footer", Some(String::from(IMAGE_URL)))
        .image(IMAGE_URL)
        .thumbnail(IMAGE_URL)
        .author("Lmao#0001", Some(String::from(IMAGE_URL)), Some(String::from(IMAGE_URL)))
        .field("name", "value", false))).await?;

Get started

To get started, simply add the crate to your Cargo.toml.

[dependencies]
webhook = "1.0.0"

If you only want the types, you can get rid of the networking-related dependencies by using the feature models.

[dependencies]
webhook = { version = "1.0.0", features = ["models"] }

To do

  • Attachments
  • Components

Contribute

Any type of contribution is greatly appreciated.

Dependencies

~0.6–13MB
~162K SLoC