Skip to content

Discord Webhook API Wrapper for Rust.

License

Notifications You must be signed in to change notification settings

acousticly/webhook-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Discord Webhook API Wrapper for Rust.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%