diff options
Diffstat (limited to 'src/model/channel.rs')
| -rw-r--r-- | src/model/channel.rs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/model/channel.rs b/src/model/channel.rs index 931524e..42d5d08 100644 --- a/src/model/channel.rs +++ b/src/model/channel.rs @@ -703,6 +703,16 @@ impl ChannelId { after.map(|u| u.into().0)) } + /// Retrieves the channel'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_channel_webhooks(self.0) + } + /// Pins a [`Message`] to the channel. #[inline] pub fn pin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> { @@ -819,16 +829,6 @@ impl ChannelId { pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> { rest::unpin_message(self.0, message_id.into().0) } - - /// Retrieves the channel'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_channel_webhooks(self.0) - } } impl From<Channel> for ChannelId { @@ -2109,6 +2109,16 @@ impl GuildChannel { self.id.get_reaction_users(message_id, reaction_type, limit, after) } + /// Retrieves the channel'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() + } + /// Attempts to find this channel's guild in the Cache. /// /// **Note**: Right now this performs a clone of the guild. This will be @@ -2202,16 +2212,6 @@ impl GuildChannel { pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> { self.id.unpin(message_id) } - - /// Retrieves the channel'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 fmt::Display for GuildChannel { |