aboutsummaryrefslogtreecommitdiff
path: root/examples/07_sample_bot_structure/src/commands
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/commands
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/commands')
-rw-r--r--examples/07_sample_bot_structure/src/commands/meta.rs10
-rw-r--r--examples/07_sample_bot_structure/src/commands/owner.rs11
2 files changed, 3 insertions, 18 deletions
diff --git a/examples/07_sample_bot_structure/src/commands/meta.rs b/examples/07_sample_bot_structure/src/commands/meta.rs
index 18ee48d..49197a8 100644
--- a/examples/07_sample_bot_structure/src/commands/meta.rs
+++ b/examples/07_sample_bot_structure/src/commands/meta.rs
@@ -1,13 +1,3 @@
-command!(latency(ctx, msg) {
- let latency = ctx.shard.lock()
- .latency()
- .map_or_else(|| "N/A".to_string(), |s| {
- format!("{}.{}s", s.as_secs(), s.subsec_nanos())
- });
-
- let _ = msg.channel_id.say(latency);
-});
-
command!(ping(_ctx, msg) {
let _ = msg.channel_id.say("Pong!");
});
diff --git a/examples/07_sample_bot_structure/src/commands/owner.rs b/examples/07_sample_bot_structure/src/commands/owner.rs
index e80c19d..7836b8f 100644
--- a/examples/07_sample_bot_structure/src/commands/owner.rs
+++ b/examples/07_sample_bot_structure/src/commands/owner.rs
@@ -1,10 +1,5 @@
command!(quit(ctx, msg, _args) {
- match ctx.quit() {
- Ok(()) => {
- let _ = msg.reply("Shutting down!");
- },
- Err(why) => {
- let _ = msg.reply(&format!("Failed to shutdown: {:?}", why));
- },
- }
+ ctx.quit();
+
+ let _ = msg.reply("Shutting down!");
});