Skip to main content

Module webhook

Module webhook 

Source
Expand description

Webhooks without a bot: WebhookClient (D-238), and the errors of the webhook methods.

use djs_rs::WebhookClient;

let webhook = WebhookClient::from_url(&std::env::var("WEBHOOK_URL")?)?;
let message = webhook.send("Deployed!").await?;
println!("sent {}", message.id);

Structs§

InvalidWebhookUrl
The URL given to WebhookClient::from_url is not a Discord webhook URL (D-241).
WebhookClient
A webhook used through its ID and token, without a bot token or a gateway connection: sending messages to a channel from a script, a CI job or a server.

Enums§

WebhookError
An error of a webhook method that needs the webhook’s token (D-240).