aboutsummaryrefslogtreecommitdiff
path: root/src/client/mod.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-11-11 13:07:18 -0800
committerAustin Hellyer <[email protected]>2016-11-11 13:07:18 -0800
commita40d821a7cf0361bbffdedcb5f91761a1a285401 (patch)
treeb787a46ad5619bb29121f6134bff4f0005fa2f96 /src/client/mod.rs
parentAdd a clippy config (diff)
downloadserenity-a40d821a7cf0361bbffdedcb5f91761a1a285401.tar.xz
serenity-a40d821a7cf0361bbffdedcb5f91761a1a285401.zip
Add delete_message_reactions + register event
Add the `delete_message_reactions` endpoint (`DELETE /channels/{}/messages/{}/reactions`) and implement a method on the `Message` struct for easy access, `delete_reactions`. Register the `MESSAGE_REACTION_REMOVE_ALL` event and add an event handler.
Diffstat (limited to 'src/client/mod.rs')
-rw-r--r--src/client/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index 77ec3e1..4db7a4e 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -713,6 +713,16 @@ impl Client {
.on_reaction_remove = Some(Arc::new(handler))
}
+ /// Attached a handler for when a [`ReactionRemoveAll`] is received.
+ ///
+ /// [`ReactionRemoveAll`]: ../model/enum.Event.html#variant.ReactionRemoveAll
+ pub fn on_reaction_remove_all<F>(&mut self, handler: F)
+ where F: Fn(Context, ChannelId, MessageId) + Send + Sync + 'static {
+ self.event_store.lock()
+ .unwrap()
+ .on_reaction_remove_all = Some(Arc::new(handler))
+ }
+
/// Register an event to be called whenever a Ready event is received.
///
/// Registering a handler for the ready event is good for noting when your