aboutsummaryrefslogtreecommitdiff
path: root/src/model/webhook.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-11-15 11:36:53 -0800
committerAustin Hellyer <[email protected]>2016-11-15 11:36:53 -0800
commit5ccfaaa3b1a030b1fd0dcd364bdae001347d36e4 (patch)
tree7cf531e4790109d6d7edd26bc5b483378d5ba5ac /src/model/webhook.rs
parentEmbed Author: everything but 'name' is optional (diff)
downloadserenity-5ccfaaa3b1a030b1fd0dcd364bdae001347d36e4.tar.xz
serenity-5ccfaaa3b1a030b1fd0dcd364bdae001347d36e4.zip
Add state/framework/etc. conditional compile flags
This adds conditional compilation for the following features, in addition to the voice conditional compilation flag: - extras (message builder) - framework - methods - state These 4 are enabled _by default_, while the `voice` feature flag is disabled. Disabling the state will allow incredibly low-memory bots.
Diffstat (limited to 'src/model/webhook.rs')
-rw-r--r--src/model/webhook.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/model/webhook.rs b/src/model/webhook.rs
index 04f6d5d..f0d7b16 100644
--- a/src/model/webhook.rs
+++ b/src/model/webhook.rs
@@ -12,6 +12,7 @@ impl Webhook {
/// authentication is not required.
///
/// [`http::delete_webhook_with_token`]: ../client/http/fn.delete_webhook_with_token.html
+ #[cfg(feature="methods")]
pub fn delete(&self) -> Result<()> {
http::delete_webhook_with_token(self.id.0, &self.token)
}
@@ -62,6 +63,7 @@ impl Webhook {
///
/// [`http::edit_webhook`]: ../client/http/fn.edit_webhook.html
/// [`http::edit_webhook_with_token`]: ../client/http/fn.edit_webhook_with_token.html
+ #[cfg(feature="methods")]
pub fn edit(&mut self, name: Option<&str>, avatar: Option<&str>)
-> Result<()> {
if name.is_none() && avatar.is_none() {
@@ -141,6 +143,7 @@ impl Webhook {
/// .embeds(vec![embed]))
/// .expect("err executing");
/// ```
+ #[cfg(feature="methods")]
pub fn execute<F>(&self, f: F) -> Result<Message>
where F: FnOnce(ExecuteWebhook) -> ExecuteWebhook {
let map = f(ExecuteWebhook::default()).0.build();
@@ -155,6 +158,7 @@ impl Webhook {
/// authentication is not required.
///
/// [`http::get_webhook_with_token`]: ../client/http/fn.get_webhook_with_token.html
+ #[cfg(feature="methods")]
pub fn refresh(&mut self) -> Result<()> {
match http::get_webhook_with_token(self.id.0, &self.token) {
Ok(replacement) => {