diff options
Diffstat (limited to 'examples/07_sample_bot_structure/src')
| -rw-r--r-- | examples/07_sample_bot_structure/src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/07_sample_bot_structure/src/main.rs b/examples/07_sample_bot_structure/src/main.rs index 8962d55..7a0c216 100644 --- a/examples/07_sample_bot_structure/src/main.rs +++ b/examples/07_sample_bot_structure/src/main.rs @@ -21,7 +21,9 @@ use std::env; struct Handler; impl EventHandler for Handler {} fn main() { - 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"); client.with_framework(StandardFramework::new() .configure(|c| c.prefix("~")) |