Crates.io | dwbhk |
lib.rs | dwbhk |
version | 0.1.2 |
source | src |
created_at | 2021-08-30 20:29:31.516914 |
updated_at | 2021-10-17 21:00:21.425719 |
description | dwbhk-rs is a library for working with Discord Webhooks |
homepage | https://github.com/TheDutchMC/dwbhk-rs |
repository | https://github.com/TheDutchMC/dwbhk-rs |
max_upload_size | |
id | 444486 |
size | 31,456 |
This is a Rust library for firing a Discord webhook
no-panic
Disables panic!
in the crateblocking
Enables reqwest
's blocking
feature. One can use the blocking methods with the execute_url_sync
and execute_sync
on WebhookRequest
Example usage:
let req = WebhookRequestBuilder::new()
.set_data(WebhookBuilder::new()
.set_embeds(vec![
EmbedBuilder::new()
.set_title("The Embed Title")
.set_color_hex("#ff0000") // Red
.set_description("Hello world!")
.set_fields(vec![
EmbedFieldBuilder::new()
.set_name("Field Name")
.set_value("Field Value")
.build()
]
)
.build()
]
)
.build()
)
.build();
let url = get_discord_webhook_url();
req.execute_url(&url);