aboutsummaryrefslogtreecommitdiff
path: root/examples/07_sample_bot_structure/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/07_sample_bot_structure/src/main.rs')
-rw-r--r--examples/07_sample_bot_structure/src/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/07_sample_bot_structure/src/main.rs b/examples/07_sample_bot_structure/src/main.rs
index 42ccd64..37227cc 100644
--- a/examples/07_sample_bot_structure/src/main.rs
+++ b/examples/07_sample_bot_structure/src/main.rs
@@ -14,13 +14,16 @@ extern crate serenity;
mod commands;
-use serenity::Client;
+use serenity::prelude::*;
+use serenity::framework::BuiltinFramework;
use std::env;
+struct Handler; impl EventHandler for Handler {}
+
fn main() {
- let mut client = Client::new(&env::var("DISCORD_TOKEN").unwrap());
+ let mut client = Client::new(&env::var("DISCORD_TOKEN").unwrap(), Handler);
- client.with_framework(|f| f
+ client.with_framework(BuiltinFramework::new()
.configure(|c| c.prefix("~"))
.command("ping", |c| c.exec(commands::meta::ping))
.command("latency", |c| c.exec(commands::meta::latency))