diff options
| author | Zeyla Hellyer <[email protected]> | 2017-02-25 11:50:27 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-02-25 11:50:27 -0800 |
| commit | aaf4f2eb89ef90db195da9fcc0db225f7858d952 (patch) | |
| tree | 5fb6b1c027ae6284cdf5982e3b7b912a14d2e8cb /examples/02_transparent_guild_sharding/src | |
| parent | Make logo more better (diff) | |
| download | serenity-aaf4f2eb89ef90db195da9fcc0db225f7858d952.tar.xz serenity-aaf4f2eb89ef90db195da9fcc0db225f7858d952.zip | |
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.
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 b0a639a..513a574 100644 --- a/examples/02_transparent_guild_sharding/src/main.rs +++ b/examples/02_transparent_guild_sharding/src/main.rs @@ -27,8 +27,8 @@ fn main() { .expect("Expected a token in the environment"); let mut client = Client::login_bot(&token); - client.on_message(|ctx, message| { - if message.content == "!ping" { + client.on_message(|ctx, msg| { + 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 // concurrently. @@ -40,7 +40,7 @@ fn main() { } } - if let Err(why) = ctx.say("Pong!") { + if let Err(why) = msg.channel_id.say("Pong!") { println!("Error sending message: {:?}", why); } } |