diff options
Diffstat (limited to 'examples/07_sample_bot_structure/src')
| -rw-r--r-- | examples/07_sample_bot_structure/src/main.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/07_sample_bot_structure/src/main.rs b/examples/07_sample_bot_structure/src/main.rs index 37f6c98..4c0ff8b 100644 --- a/examples/07_sample_bot_structure/src/main.rs +++ b/examples/07_sample_bot_structure/src/main.rs @@ -48,7 +48,10 @@ fn main() { // `RUST_LOG` to debug`. env_logger::init().expect("Failed to initialize env_logger"); - let mut client = Client::new(&env::var("DISCORD_TOKEN").unwrap(), Handler); + let token = env::var("DISCORD_TOKEN") + .expect("Expected a token in the environment"); + + let mut client = Client::new(&token, Handler).expect("Err creating client"); let owners = match http::get_current_application_info() { Ok(info) => { |