diff options
| author | Valdemar Erk <[email protected]> | 2018-05-29 11:59:29 +0200 |
|---|---|---|
| committer | Valdemar Erk <[email protected]> | 2018-05-29 11:59:29 +0200 |
| commit | 82d91c53f585e356ade335ff08233857527f7abd (patch) | |
| tree | 54cedc60bbbd463d8c9a94c7d99912c19740c22b /examples/01_basic_ping_bot | |
| parent | Merge branch 'futures' into v0.6.x (diff) | |
| download | serenity-82d91c53f585e356ade335ff08233857527f7abd.tar.xz serenity-82d91c53f585e356ade335ff08233857527f7abd.zip | |
Updated example 01 to work with the newest version.
Diffstat (limited to 'examples/01_basic_ping_bot')
| -rw-r--r-- | examples/01_basic_ping_bot/src/main.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/01_basic_ping_bot/src/main.rs b/examples/01_basic_ping_bot/src/main.rs index 7d858f1..3160390 100644 --- a/examples/01_basic_ping_bot/src/main.rs +++ b/examples/01_basic_ping_bot/src/main.rs @@ -1,4 +1,4 @@ -#![feature(proc_macro, conservative_impl_trait, generators)] +#![feature(proc_macro, generators)] extern crate futures_await as futures; extern crate serenity; @@ -7,10 +7,9 @@ extern crate tokio_core; use futures::prelude::*; use serenity::gateway::Shard; use serenity::model::event::{Event, GatewayEvent}; -use serenity::model::gateway::Game; -use serenity::model::user::OnlineStatus; use std::error::Error; use std::env; +use std::rc::Rc; use tokio_core::reactor::{Core, Handle}; fn main() { @@ -23,8 +22,8 @@ fn main() { #[async] fn try_main(handle: Handle) -> Result<(), Box<Error + 'static>> { // Configure the client with your Discord bot token in the environment. - let token = env::var("DISCORD_TOKEN") - .expect("Expected a token in the environment"); + let token = Rc::new(env::var("DISCORD_TOKEN") + .expect("Expected a token in the environment")); // Create a new shard, specifying the token, the ID of the shard (0 of 1), // and a handle to the event loop |