From dc73d1a4bad07b453a9d60a6c8f8c187a7e42450 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Tue, 20 Jun 2017 11:28:52 -0700 Subject: Add 'wait' parameter to http::execute_webhook The 'wait' parameter allows you to specify waiting for the Message to be sent prior to receiving a response, which will have Discord include the JSON representation of the Message in the body. --- src/builder/execute_webhook.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/builder/execute_webhook.rs') diff --git a/src/builder/execute_webhook.rs b/src/builder/execute_webhook.rs index 68a39fc..e8b9042 100644 --- a/src/builder/execute_webhook.rs +++ b/src/builder/execute_webhook.rs @@ -44,7 +44,7 @@ use ::internal::prelude::*; /// .name("Rust by Example") /// .value("A collection of Rust examples on topics, useable in-browser"))); /// -/// let _ = webhook.execute(|w| w +/// let _ = webhook.execute(false, |w| w /// .content("Here's some information on Rust:") /// .embeds(vec![website, resources])); /// ``` @@ -69,7 +69,7 @@ impl ExecuteWebhook { /// # /// let avatar_url = "https://i.imgur.com/KTs6whd.jpg"; /// - /// let _ = webhook.execute(|w| w + /// let _ = webhook.execute(false, |w| w /// .avatar_url(avatar_url) /// .content("Here's a webhook")); /// ``` @@ -93,7 +93,7 @@ impl ExecuteWebhook { /// # /// # let webhook = rest::get_webhook_with_token(0, "").unwrap(); /// # - /// if let Err(why) = webhook.execute(|w| w.content("foo")) { + /// if let Err(why) = webhook.execute(false, |w| w.content("foo")) { /// println!("Err sending webhook: {:?}", why); /// } /// ``` @@ -135,7 +135,7 @@ impl ExecuteWebhook { /// # /// # let webhook = rest::get_webhook_with_token(0, "").unwrap(); /// # - /// if let Err(why) = webhook.execute(|w| w.content("hello").tts(true)) { + /// if let Err(why) = webhook.execute(false, |w| w.content("hello").tts(true)) { /// println!("Err sending webhook: {:?}", why); /// } /// ``` @@ -156,7 +156,7 @@ impl ExecuteWebhook { /// # /// # let webhook = rest::get_webhook_with_token(0, "").unwrap(); /// # - /// if let Err(why) = webhook.execute(|w| w.content("hello").username("hakase")) { + /// if let Err(why) = webhook.execute(false, |w| w.content("hello").username("hakase")) { /// println!("Err sending webhook: {:?}", why); /// } /// ``` -- cgit v1.2.3