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 /src/client/context.rs | |
| 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 'src/client/context.rs')
| -rw-r--r-- | src/client/context.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/client/context.rs b/src/client/context.rs index e27c134..261c8ff 100644 --- a/src/client/context.rs +++ b/src/client/context.rs @@ -71,7 +71,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_message(&self, ctx: Context, msg: Message) { + /// fn message(&self, ctx: Context, msg: Message) { /// if msg.content == "!changename" { /// ctx.edit_profile(|e| e.username("Edward Elric")); /// } @@ -122,7 +122,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_message(&self, ctx: Context, msg: Message) { + /// fn message(&self, ctx: Context, msg: Message) { /// if msg.content == "!online" { /// ctx.online(); /// } @@ -151,7 +151,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_message(&self, ctx: Context, msg: Message) { + /// fn message(&self, ctx: Context, msg: Message) { /// if msg.content == "!idle" { /// ctx.idle(); /// } @@ -180,7 +180,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_message(&self, ctx: Context, msg: Message) { + /// fn message(&self, ctx: Context, msg: Message) { /// if msg.content == "!dnd" { /// ctx.dnd(); /// } @@ -210,7 +210,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_ready(&self, ctx: Context, _: Ready) { + /// fn ready(&self, ctx: Context, _: Ready) { /// ctx.invisible(); /// } /// } @@ -241,7 +241,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_resume(&self, ctx: Context, _: ResumedEvent) { + /// fn resume(&self, ctx: Context, _: ResumedEvent) { /// ctx.reset_presence(); /// } /// } @@ -272,7 +272,7 @@ impl Context { /// /// struct Handler; /// impl EventHandler for Handler { - /// fn on_message(&self, ctx: Context, msg: Message) { + /// fn message(&self, ctx: Context, msg: Message) { /// let args = msg.content.splitn(2, ' ').collect::<Vec<&str>>(); /// /// if args.len() < 2 || *unsafe { args.get_unchecked(0) } != "~setgame" { @@ -312,7 +312,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_ready(&self, ctx: Context, _: Ready) { + /// fn ready(&self, ctx: Context, _: Ready) { /// ctx.set_game_name("test"); /// } /// } @@ -351,7 +351,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_ready(&self, ctx: Context, _: Ready) { + /// fn ready(&self, ctx: Context, _: Ready) { /// use serenity::model::OnlineStatus; /// /// ctx.set_presence(None, OnlineStatus::Idle); @@ -370,7 +370,7 @@ impl Context { /// struct Handler; /// /// impl EventHandler for Handler { - /// fn on_ready(&self, context: Context, _: Ready) { + /// fn ready(&self, context: Context, _: Ready) { /// use serenity::model::{Game, OnlineStatus}; /// /// let game = Game::playing("Heroes of the Storm"); |