aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaiddog <[email protected]>2017-11-18 17:23:41 -0600
committeralex <[email protected]>2017-11-19 00:23:41 +0100
commitfd19446fcc4c7ad2c9f634c97fa1c056440a6abd (patch)
tree6ed6fcbf1aaff8de0be9abe0ef192183fa22a45c
parentFix framework doctests (diff)
downloadserenity-fd19446fcc4c7ad2c9f634c97fa1c056440a6abd.tar.xz
serenity-fd19446fcc4c7ad2c9f634c97fa1c056440a6abd.zip
Add a method to get a message from a reaction (#220)
-rw-r--r--src/model/channel/reaction.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/model/channel/reaction.rs b/src/model/channel/reaction.rs
index cf7963f..1e6c454 100644
--- a/src/model/channel/reaction.rs
+++ b/src/model/channel/reaction.rs
@@ -116,6 +116,16 @@ impl Reaction {
after.map(|u| u.into().0),
)
}
+
+ /// Retrieves the [`Message`] associated with this reaction.
+ ///
+ /// Requires the [Read Message History] permission.
+ ///
+ /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [`Message`]: struct.Message.html
+ pub fn message(&self) -> Result<Message> {
+ self.channel_id.message(self.message_id)
+ }
}
/// The type of a [`Reaction`] sent.