aboutsummaryrefslogtreecommitdiff
path: root/src/model/guild.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/guild.rs')
-rw-r--r--src/model/guild.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/model/guild.rs b/src/model/guild.rs
index a72a187..e8aff56 100644
--- a/src/model/guild.rs
+++ b/src/model/guild.rs
@@ -125,6 +125,16 @@ impl Guild {
self.icon.as_ref().map(|icon|
format!(cdn_concat!("/icons/{}/{}.jpg"), self.id, icon))
}
+
+ /// Retrieves the guild's webhooks.
+ ///
+ /// **Note**: Requires the [Manage Webhooks] permission.
+ ///
+ /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html
+ #[inline]
+ pub fn webhooks(&self) -> Result<Vec<Webhook>> {
+ http::get_guild_webhooks(self.id.0)
+ }
}
impl LiveGuild {
@@ -674,6 +684,16 @@ impl LiveGuild {
http::remove_ban(self.id.0, user.into().0)
}
+
+ /// Retrieves the guild's webhooks.
+ ///
+ /// **Note**: Requires the [Manage Webhooks] permission.
+ ///
+ /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html
+ #[inline]
+ pub fn webhooks(&self) -> Result<Vec<Webhook>> {
+ http::get_guild_webhooks(self.id.0)
+ }
}
impl Member {