diff options
| author | Austin Hellyer <[email protected]> | 2017-01-24 08:55:49 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2017-01-24 08:55:49 -0800 |
| commit | 47510594e5c939406ebccec8af7e3107a338c7bc (patch) | |
| tree | 8def4138c4d6d33ae40e290c51a39c131ae2850d /examples/04_message_builder/src | |
| parent | Code style (diff) | |
| download | serenity-47510594e5c939406ebccec8af7e3107a338c7bc.tar.xz serenity-47510594e5c939406ebccec8af7e3107a338c7bc.zip | |
Update examples for OOP style update
Diffstat (limited to 'examples/04_message_builder/src')
| -rw-r--r-- | examples/04_message_builder/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/04_message_builder/src/main.rs b/examples/04_message_builder/src/main.rs index 2712fe6..8817065 100644 --- a/examples/04_message_builder/src/main.rs +++ b/examples/04_message_builder/src/main.rs @@ -10,9 +10,9 @@ fn main() { .expect("Expected a token in the environment"); let mut client = Client::login_bot(&token); - client.on_message(|context, message| { + client.on_message(|ctx, message| { if message.content == "!ping" { - let channel = match context.get_channel(message.channel_id) { + let channel = match ctx.get_channel() { Ok(channel) => channel, Err(why) => { println!("Error getting channel: {:?}", why); @@ -32,7 +32,7 @@ fn main() { .push(" channel") .build(); - if let Err(why) = context.say(&response) { + if let Err(why) = ctx.say(&response) { println!("Error sending message: {:?}", why); } } |