Crates.io | discord-webhook |
lib.rs | discord-webhook |
version | 0.1.0 |
source | src |
created_at | 2022-03-07 19:01:02.077732 |
updated_at | 2022-03-07 19:02:47.1561 |
description | Discord Webhook API Wrapper |
homepage | |
repository | https://github.com/thoo0224/webhook-rs |
max_upload_size | |
id | 545142 |
size | 38,216 |
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?;
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"] }
Any type of contribution is greatly appreciated.