From aaf4f2eb89ef90db195da9fcc0db225f7858d952 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Sat, 25 Feb 2017 11:50:27 -0800 Subject: Update examples for Context changes Due to many of the channel methods being removed from the Context (due to basically duplicating methods and code from `ChannelId`), update all of the examples to use methods on `ChannelId` instead. --- examples/01_basic_ping_bot/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/01_basic_ping_bot/src') diff --git a/examples/01_basic_ping_bot/src/main.rs b/examples/01_basic_ping_bot/src/main.rs index 991b537..b2c739a 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(|ctx, message| { - if message.content == "!ping" { + client.on_message(|_ctx, msg| { + if msg.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) = ctx.say("Pong!") { + if let Err(why) = msg.channel_id.say("Pong!") { println!("Error sending message: {:?}", why); } } -- cgit v1.2.3