aboutsummaryrefslogtreecommitdiff
path: root/src/client/event_handler.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-05 23:06:00 +0200
committeracdenisSK <[email protected]>2017-07-05 23:06:16 +0200
commit3017f6dbc02e6189c69491993e828e2a7595cbed (patch)
tree2debf2f80e901935eb38c2c7bc89bf3fbacd2d0e /src/client/event_handler.rs
parentRemove `checks_passed` in favour of the `Iterator::all` method (diff)
downloadserenity-3017f6dbc02e6189c69491993e828e2a7595cbed.tar.xz
serenity-3017f6dbc02e6189c69491993e828e2a7595cbed.zip
Add an `is_new` to the arguments of the `guild_create` handler
To make a better distinction from a guild that the bot's already in and from the ones it's joining
Diffstat (limited to 'src/client/event_handler.rs')
-rw-r--r--src/client/event_handler.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/event_handler.rs b/src/client/event_handler.rs
index dd5186e..d8baecb 100644
--- a/src/client/event_handler.rs
+++ b/src/client/event_handler.rs
@@ -8,7 +8,6 @@ use ::model::*;
#[cfg(feature="cache")]
use std::sync::RwLock;
-#[allow(type_complexity)]
pub trait EventHandler {
#[cfg(feature="cache")]
fn on_cached(&self, _: Context, _: Vec<GuildId>) {}
@@ -23,6 +22,9 @@ pub trait EventHandler {
fn on_channel_update(&self, _: Context, _: Channel) {}
fn on_guild_ban_addition(&self, _: Context, _: GuildId, _: User) {}
fn on_guild_ban_removal(&self, _: Context, _: GuildId, _: User) {}
+ #[cfg(feature="cache")]
+ fn on_guild_create(&self, _: Context, _: Guild, _: bool) {}
+ #[cfg(not(feature="cache"))]
fn on_guild_create(&self, _: Context, _: Guild) {}
#[cfg(feature="cache")]
fn on_guild_delete(&self, _: Context, _: PartialGuild, _: Option<Arc<RwLock<Guild>>>) {}