diff options
| author | Zeyla Hellyer <[email protected]> | 2017-10-22 18:01:42 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-22 18:01:42 -0700 |
| commit | b328b3e09b0095abb54530dc4d50db6b4e3e1779 (patch) | |
| tree | 9af675bd9a608205dd2c29975038822327601a22 /examples/02_transparent_guild_sharding/src | |
| parent | Remove setting of the afk field in shards (diff) | |
| download | serenity-b328b3e09b0095abb54530dc4d50db6b4e3e1779.tar.xz serenity-b328b3e09b0095abb54530dc4d50db6b4e3e1779.zip | |
Remove `on_` prefix to EventHandler tymethods
It was voted that the `on_` prefix is unnecessary, so these have been
dropped.
Diffstat (limited to 'examples/02_transparent_guild_sharding/src')
| -rw-r--r-- | examples/02_transparent_guild_sharding/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/02_transparent_guild_sharding/src/main.rs b/examples/02_transparent_guild_sharding/src/main.rs index 55b20c1..00b768c 100644 --- a/examples/02_transparent_guild_sharding/src/main.rs +++ b/examples/02_transparent_guild_sharding/src/main.rs @@ -25,7 +25,7 @@ use std::env; struct Handler; impl EventHandler for Handler { - fn on_message(&self, ctx: Context, msg: Message) { + fn message(&self, ctx: Context, msg: Message) { if msg.content == "!ping" { // The current shard needs to be unlocked so it can be read from, as // multiple threads may otherwise attempt to read from or mutate it @@ -39,10 +39,10 @@ impl EventHandler for Handler { if let Err(why) = msg.channel_id.say("Pong!") { println!("Error sending message: {:?}", why); } - } + } } - fn on_ready(&self, _: Context, ready: Ready) { + fn ready(&self, _: Context, ready: Ready) { println!("{} is connected!", ready.user.name); } } |