diff options
| author | Austin Hellyer <[email protected]> | 2017-01-24 08:05:39 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2017-01-24 08:05:39 -0800 |
| commit | e8a90860d1e451e21d3bf728178957fe54cf106d (patch) | |
| tree | 298ccf208dd2cbd16e366ab19f3f3d89f0b5dda7 /src/model/guild.rs | |
| parent | Use Id methods where possible (diff) | |
| download | serenity-e8a90860d1e451e21d3bf728178957fe54cf106d.tar.xz serenity-e8a90860d1e451e21d3bf728178957fe54cf106d.zip | |
Rename 'webhooks' methods to 'get_webhooks'
Diffstat (limited to 'src/model/guild.rs')
| -rw-r--r-- | src/model/guild.rs | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/model/guild.rs b/src/model/guild.rs index e356385..1e3b10e 100644 --- a/src/model/guild.rs +++ b/src/model/guild.rs @@ -800,6 +800,16 @@ impl Guild { self.id.get_prune_count(days) } + /// Retrieves the guild's webhooks. + /// + /// **Note**: Requires the [Manage Webhooks] permission. + /// + /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html + #[inline] + pub fn get_webhooks(&self) -> Result<Vec<Webhook>> { + self.id.get_webhooks() + } + /// Returns the formatted URL of the guild's icon, if one exists. pub fn icon_url(&self) -> Option<String> { self.icon.as_ref().map(|icon| @@ -1097,16 +1107,6 @@ impl Guild { self.id.unban(user_id) } - - /// 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>> { - self.id.webhooks() - } } impl GuildId { @@ -1478,6 +1478,16 @@ impl GuildId { rest::get_guild_prune_count(self.0, map) } + /// Retrieves the guild's webhooks. + /// + /// **Note**: Requires the [Manage Webhooks] permission. + /// + /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html + #[inline] + pub fn get_webhooks(&self) -> Result<Vec<Webhook>> { + rest::get_guild_webhooks(self.0) + } + /// Kicks a [`Member`] from the guild. /// /// Requires the [Kick Members] permission. @@ -1581,16 +1591,6 @@ impl GuildId { pub fn unban<U: Into<UserId>>(&self, user_id: U) -> Result<()> { rest::remove_ban(self.0, user_id.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>> { - rest::get_guild_webhooks(self.0) - } } impl fmt::Display for GuildId { @@ -2229,6 +2229,16 @@ impl PartialGuild { self.id.get_prune_count(days) } + /// Retrieves the guild's webhooks. + /// + /// **Note**: Requires the [Manage Webhooks] permission. + /// + /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html + #[inline] + pub fn get_webhooks(&self) -> Result<Vec<Webhook>> { + self.id.get_webhooks() + } + /// Kicks a [`Member`] from the guild. /// /// Requires the [Kick Members] permission. @@ -2361,16 +2371,6 @@ impl PartialGuild { pub fn unban<U: Into<UserId>>(&self, user_id: U) -> Result<()> { self.id.unban(user_id) } - - /// 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>> { - self.id.webhooks() - } } impl PossibleGuild<Guild> { |