aboutsummaryrefslogtreecommitdiff
path: root/src/client/mod.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2016-11-07 11:43:15 -0800
committerAustin Hellyer <[email protected]>2016-11-07 11:43:15 -0800
commita114a55efb5b08f9e5f289203db2dfd4db82852a (patch)
tree8522e8eb3e77534ecf5c8e0208746b587eae887b /src/client/mod.rs
parentAdd Attachment::download{,to_directory} (diff)
downloadserenity-a114a55efb5b08f9e5f289203db2dfd4db82852a.tar.xz
serenity-a114a55efb5b08f9e5f289203db2dfd4db82852a.zip
Add webhook support
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 95af69f..e010ebf 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -864,6 +864,16 @@ impl Client {
.on_voice_server_update = Some(Arc::new(handler));
}
+ /// Attaches a handler for when a [`WebhookUpdate`] is received.
+ ///
+ /// [`WebhookUpdate`]: ../model/enum.Event.html#variant.WebhookUpdate
+ pub fn on_webhook_update<F>(&mut self, handler: F)
+ where F: Fn(Context, GuildId, ChannelId) + Send + Sync + 'static {
+ self.event_store.lock()
+ .unwrap()
+ .on_webhook_update = Some(Arc::new(handler));
+ }
+
// Shard data layout is:
// 0: first shard number to initialize
// 1: shard number to initialize up to and including