1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! `discord_hook` — Send messages to Discord via webhooks.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use discord_hook::{WebhookClient, WebhookMessage, Embed};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), discord_hook::WebhookError> {
//! let client = WebhookClient::new("https://discord.com/api/webhooks/ID/TOKEN")?;
//!
//! let message = WebhookMessage::builder()
//! .content("Hello from discord_hook!")
//! .username("MyBot")
//! .embed(
//! Embed::builder()
//! .title("Rich embed")
//! .description("Supports titles, fields, colours, and more.")
//! .color(0x5865F2) // Discord blurple
//! .field("Library", "discord_hook", true)
//! .build(),
//! )
//! .build()?;
//!
//! client.send(&message).await
//! }
//! ```
//!
//! # Rate limits
//!
//! When Discord returns HTTP 429 the client surfaces a
//! [`WebhookError::RateLimited`] error that contains `retry_after_ms`.
//! Use that value to back off before retrying.
pub use ;
pub use WebhookError;
pub use WebhookSender;
pub use ;