diff options
| author | Austin Hellyer <[email protected]> | 2016-11-07 11:43:15 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-07 11:43:15 -0800 |
| commit | a114a55efb5b08f9e5f289203db2dfd4db82852a (patch) | |
| tree | 8522e8eb3e77534ecf5c8e0208746b587eae887b /src/model/guild.rs | |
| parent | Add Attachment::download{,to_directory} (diff) | |
| download | serenity-a114a55efb5b08f9e5f289203db2dfd4db82852a.tar.xz serenity-a114a55efb5b08f9e5f289203db2dfd4db82852a.zip | |
Add webhook support
Diffstat (limited to 'src/model/guild.rs')
| -rw-r--r-- | src/model/guild.rs | 20 |
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 { |