aboutsummaryrefslogtreecommitdiff
path: root/examples/03_struct_utilities/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-02-25 11:50:27 -0800
committerZeyla Hellyer <[email protected]>2017-02-25 11:50:27 -0800
commitaaf4f2eb89ef90db195da9fcc0db225f7858d952 (patch)
tree5fb6b1c027ae6284cdf5982e3b7b912a14d2e8cb /examples/03_struct_utilities/src
parentMake logo more better (diff)
downloadserenity-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/03_struct_utilities/src')
-rw-r--r--examples/03_struct_utilities/src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/03_struct_utilities/src/main.rs b/examples/03_struct_utilities/src/main.rs
index d31b840..4c3a0bb 100644
--- a/examples/03_struct_utilities/src/main.rs
+++ b/examples/03_struct_utilities/src/main.rs
@@ -18,8 +18,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 == "!messageme" {
+ client.on_message(|_ctx, msg| {
+ if msg.content == "!messageme" {
// If the `methods` feature is enabled, then model structs will
// have a lot of useful methods implemented, to avoid using an
// often otherwise bulky Context, or even much lower-level `rest`
@@ -28,7 +28,7 @@ fn main() {
// In this case, you can direct message a User directly by simply
// calling a method on its instance, with the content of the
// message.
- if let Err(why) = message.author.dm("Hello!") {
+ if let Err(why) = msg.author.dm("Hello!") {
println!("Error when direct messaging user: {:?}", why);
}
}