diff options
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel/reaction.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/model/channel/reaction.rs b/src/model/channel/reaction.rs index 8fe8dc1..b2fdffd 100644 --- a/src/model/channel/reaction.rs +++ b/src/model/channel/reaction.rs @@ -34,9 +34,9 @@ pub struct Reaction { impl Reaction { /// Retrieves the associated the reaction was made in. /// - /// If the cache is enabled, this will search for the alread-cached channel. - /// If not - or the channel was not found - this will perform a request over - /// the REST API for the channel. + /// If the cache is enabled, this will search for the already-cached + /// channel. If not - or the channel was not found - this will perform a + /// request over the REST API for the channel. /// /// Requires the [Read Message History] permission. /// @@ -108,6 +108,16 @@ impl Reaction { self.channel_id.message(self.message_id) } + /// Retrieves the user that made the reaction. + /// + /// If the cache is enabled, this will search for the already-cached user. + /// If not - or the user was not found - this will perform a request over + /// the REST API for the user. + #[inline] + pub fn user(&self) -> Result<User> { + self.user_id.get() + } + /// Retrieves the list of [`User`]s who have reacted to a [`Message`] with a /// certain [`Emoji`]. /// |