diff options
| author | Zeyla Hellyer <[email protected]> | 2018-01-01 10:08:57 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-01-01 10:08:57 -0800 |
| commit | 7e46d8f3ac5a968df9a05f8f0006522ad14891ef (patch) | |
| tree | 121546831c15f6a7ac5aaca6659cf1ca70602af6 /src/client/event_handler.rs | |
| parent | Add a Shard Manager example in examples directory (diff) | |
| download | serenity-7e46d8f3ac5a968df9a05f8f0006522ad14891ef.tar.xz serenity-7e46d8f3ac5a968df9a05f8f0006522ad14891ef.zip | |
Add an event for shard updates
Add an event in the EventHandler to be called when a shard updates its
Connection Stage.
Diffstat (limited to 'src/client/event_handler.rs')
| -rw-r--r-- | src/client/event_handler.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/event_handler.rs b/src/client/event_handler.rs index d5bd035..552c3a9 100644 --- a/src/client/event_handler.rs +++ b/src/client/event_handler.rs @@ -4,6 +4,7 @@ use serde_json::Value; use std::collections::HashMap; use std::sync::Arc; use super::context::Context; +use ::client::bridge::gateway::event::*; pub trait EventHandler { #[cfg(feature = "cache")] @@ -67,6 +68,11 @@ pub trait EventHandler { fn presence_update(&self, _: Context, _: PresenceUpdateEvent) {} fn ready(&self, _: Context, _: Ready) {} fn resume(&self, _: Context, _: ResumedEvent) {} + + /// Called when a shard's connection stage is updated, providing the context + /// of the shard and the event information about the update. + fn shard_stage_update(&self, _: Context, _: ShardStageUpdateEvent) {} + fn typing_start(&self, _: Context, _: TypingStartEvent) {} fn unknown(&self, _: Context, _: String, _: Value) {} #[cfg(feature = "cache")] |