aboutsummaryrefslogtreecommitdiff
path: root/examples/07_sample_bot_structure/src/main.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-12-15 21:33:22 -0800
committerZeyla Hellyer <[email protected]>2017-12-16 08:45:26 -0800
commitc9efd7c147abfd1f92758719141fbb67d9792271 (patch)
tree319f4120d2efbf2748dc8ad9c23c1a14ac9e1872 /examples/07_sample_bot_structure/src/main.rs
parentRevamp the internals of `Args` (diff)
downloadserenity-c9efd7c147abfd1f92758719141fbb67d9792271.tar.xz
serenity-c9efd7c147abfd1f92758719141fbb67d9792271.zip
Fix compilation of example 07
Diffstat (limited to 'examples/07_sample_bot_structure/src/main.rs')
-rw-r--r--examples/07_sample_bot_structure/src/main.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/07_sample_bot_structure/src/main.rs b/examples/07_sample_bot_structure/src/main.rs
index 4c0ff8b..5ab06e5 100644
--- a/examples/07_sample_bot_structure/src/main.rs
+++ b/examples/07_sample_bot_structure/src/main.rs
@@ -28,11 +28,11 @@ use std::env;
struct Handler;
impl EventHandler for Handler {
- fn on_ready(&self, _: Context, ready: Ready) {
+ fn ready(&self, _: Context, ready: Ready) {
info!("Connected as {}", ready.user.name);
}
- fn on_resume(&self, _: Context, _: ResumedEvent) {
+ fn resume(&self, _: Context, _: ResumedEvent) {
info!("Resumed");
}
}
@@ -67,11 +67,10 @@ fn main() {
.configure(|c| c
.owners(owners)
.prefix("~"))
- .command("ping", |c| c.exec(commands::meta::ping))
- .command("latency", |c| c.exec(commands::meta::latency))
- .command("multiply", |c| c.exec(commands::math::multiply))
+ .command("ping", |c| c.cmd(commands::meta::ping))
+ .command("multiply", |c| c.cmd(commands::math::multiply))
.command("quit", |c| c
- .exec(commands::owner::quit)
+ .cmd(commands::owner::quit)
.owners_only(true)));
if let Err(why) = client.start() {