aboutsummaryrefslogtreecommitdiff
path: root/examples/01_basic_ping_bot/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-04-13 20:45:56 -0700
committerZeyla Hellyer <[email protected]>2017-04-19 14:53:32 -0700
commit3f03f9adc97315bb61a5c71f52365306cb8e2d1a (patch)
tree8fe0b518d1450b0657cfb75f56251fd90120807e /examples/01_basic_ping_bot/src
parentUpdate the way errors are handled in dispatch (diff)
downloadserenity-3f03f9adc97315bb61a5c71f52365306cb8e2d1a.tar.xz
serenity-3f03f9adc97315bb61a5c71f52365306cb8e2d1a.zip
Deprecate methods prefixed with `get_`
A lot of structs - such as `Guild` or `ChannelId` - have methods with prefixes of `get_`, which are generally discouraged. To fix this, deprecate them and remove them in v0.3.0.
Diffstat (limited to 'examples/01_basic_ping_bot/src')
-rw-r--r--examples/01_basic_ping_bot/src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/01_basic_ping_bot/src/main.rs b/examples/01_basic_ping_bot/src/main.rs
index 477aea1..06f66fe 100644
--- a/examples/01_basic_ping_bot/src/main.rs
+++ b/examples/01_basic_ping_bot/src/main.rs
@@ -1,9 +1,13 @@
extern crate serenity;
+#[macro_use] extern crate log;
+extern crate env_logger;
use serenity::Client;
use std::env;
fn main() {
+ env_logger::init().unwrap();
+
// Configure the client with your Discord bot token in the environment.
let token = env::var("DISCORD_TOKEN")
.expect("Expected a token in the environment");
@@ -27,6 +31,8 @@ fn main() {
if let Err(why) = msg.channel_id.say("Pong!") {
println!("Error sending message: {:?}", why);
}
+
+ println!("{:?}", serenity::client::CACHE.read().unwrap().get_guild_channel(244567637332328450));
}
});