aboutsummaryrefslogtreecommitdiff
path: root/examples/01_basic_ping_bot/src
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2017-01-24 08:55:49 -0800
committerAustin Hellyer <[email protected]>2017-01-24 08:55:49 -0800
commit47510594e5c939406ebccec8af7e3107a338c7bc (patch)
tree8def4138c4d6d33ae40e290c51a39c131ae2850d /examples/01_basic_ping_bot/src
parentCode style (diff)
downloadserenity-47510594e5c939406ebccec8af7e3107a338c7bc.tar.xz
serenity-47510594e5c939406ebccec8af7e3107a338c7bc.zip
Update examples for OOP style update
Diffstat (limited to 'examples/01_basic_ping_bot/src')
-rw-r--r--examples/01_basic_ping_bot/src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/01_basic_ping_bot/src/main.rs b/examples/01_basic_ping_bot/src/main.rs
index e00263b..991b537 100644
--- a/examples/01_basic_ping_bot/src/main.rs
+++ b/examples/01_basic_ping_bot/src/main.rs
@@ -18,13 +18,13 @@ fn main() {
//
// Event handlers are dispatched through multi-threading, and so multiple
// of a single event can be dispatched simultaneously.
- client.on_message(|context, message| {
+ client.on_message(|ctx, message| {
if message.content == "!ping" {
// Sending a message can fail, due to a network error, an
// authentication error, or lack of permissions to post in the
// channel, so log to stdout when some error happens, with a
// description of it.
- if let Err(why) = context.say("Pong!") {
+ if let Err(why) = ctx.say("Pong!") {
println!("Error sending message: {:?}", why);
}
}
@@ -36,7 +36,7 @@ fn main() {
// relationships, and more.
//
// In this case, just print what the current user's username is.
- client.on_ready(|_context, ready| {
+ client.on_ready(|_ctx, ready| {
println!("{} is connected!", ready.user.name);
});