Crate dwbhk

Source
Expand description

dwbhk is a Rust library for firing a Discord webhook

§Features

  • no-panic Disables panic! in the crate
  • blocking Enables reqwest’s blocking feature. One can use the blocking methods with the execute_url_sync and execute_sync on WebhookRequest

§Usage

Example usage:

use dwbhk::*;

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 = "YOUR_WEBHOOK";
req.execute_url(url);

Structs§

AllowedMention
The allowed mention object allows for more granular control over mentions without various hacks to the message content
AllowedMentionBuilder
Builder for AllowedMentions
Embed
An Embed
EmbedAuthor
Embed Author
EmbedAuthorBuilder
Builder for EmbedAuthor
EmbedBuilder
Builder for Embed
EmbedField
Embed Field
EmbedFieldBuilder
Builder for EmbedField
EmbedFooter
The footer of an Embed
EmbedFooterBuilder
Builder for EmbedFooter
EmbedImage
Embed image
EmbedImageBuilder
Builder for EmbedImage
EmbedProvider
Embed provider
EmbedProviderBuilder
Builder for EmbedProvider
EmbedThumbnail
Embed Thumbnail
EmbedThumbnailBuilder
Builder for EmbedThumbnail
EmbedVideo
Embed Video
EmbedVideoBuilder
Builder for EmbedVideo
Webhook
A webhook
WebhookBuilder
Builder for Webhook
WebhookRequest
A webhook request
WebhookRequestBuilder
Builder for WebhookRequest

Enums§

AllowedMentionType
The type of Allowed Mentions