aboutsummaryrefslogtreecommitdiff
path: root/src/model/webhook.rs
diff options
context:
space:
mode:
authorLakelezz <[email protected]>2018-08-12 21:43:59 +0200
committerzeyla <[email protected]>2018-08-12 12:43:59 -0700
commit71edc3a11ac450728bca19ca7cab7c84079d59f0 (patch)
treebc6197f96ba9118ffa0b104c8434585d38bb6032 /src/model/webhook.rs
parentRevert "Send silence frames upon connection (Fix #301)" (diff)
downloadserenity-71edc3a11ac450728bca19ca7cab7c84079d59f0.tar.xz
serenity-71edc3a11ac450728bca19ca7cab7c84079d59f0.zip
Use `to_`- and `as_`-methods instead of `get` and `find` on Id newtypes
Diffstat (limited to 'src/model/webhook.rs')
-rw-r--r--src/model/webhook.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/model/webhook.rs b/src/model/webhook.rs
index fca70fe..715b18b 100644
--- a/src/model/webhook.rs
+++ b/src/model/webhook.rs
@@ -226,5 +226,15 @@ impl WebhookId {
///
/// [Manage Webhooks]: ../../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_WEBHOOKS
#[inline]
- pub fn get(self) -> Result<Webhook> { http::get_webhook(self.0) }
+ #[deprecated(since = "0.5.8", note = "Use the `to_webhook`-method instead.")]
+ pub fn get(self) -> Result<Webhook> { self.to_webhook() }
+
+ /// Requests [`Webhook`] over REST API.
+ ///
+ /// **Note**: Requires the [Manage Webhooks] permission.
+ ///
+ /// [`Webhook`]: struct.Webhook.html
+ /// [Manage Webhooks]: ../../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_WEBHOOKS
+ #[inline]
+ pub fn to_webhook(self) -> Result<Webhook> { http::get_webhook(self.0) }
}