Struct webhook::client::WebhookClient
source · pub struct WebhookClient { /* private fields */ }
Expand description
A Client that sends webhooks for discord.
Implementations§
source§impl WebhookClient
impl WebhookClient
pub fn new(url: &str) -> Self
sourcepub async fn send<Func>(&self, function: Func) -> WebhookResult<bool>where
Func: Fn(&mut Message) -> &mut Message,
pub async fn send<Func>(&self, function: Func) -> WebhookResult<bool>where
Func: Fn(&mut Message) -> &mut Message,
Example
ⓘ
let client = WebhookClient::new("URL");
client.send(|message| message
.content("content")
.username("username")).await?;