aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-03-25 19:48:53 -0700
committerZeyla Hellyer <[email protected]>2018-03-25 19:48:53 -0700
commite2f3ece27934af8b7b756a70d3b6090385d37c1e (patch)
treee8085382bb92f88bfbaf95042360eb66f0a1921a /examples
parentRemove `http::FutureResult`, use `error`'s (diff)
parentRemove useless clones (#292) (diff)
downloadserenity-e2f3ece27934af8b7b756a70d3b6090385d37c1e.tar.xz
serenity-e2f3ece27934af8b7b756a70d3b6090385d37c1e.zip
Merge branch 'master' into futures
Diffstat (limited to 'examples')
-rw-r--r--examples/05_command_framework/src/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/05_command_framework/src/main.rs b/examples/05_command_framework/src/main.rs
index b3c9869..e6c7742 100644
--- a/examples/05_command_framework/src/main.rs
+++ b/examples/05_command_framework/src/main.rs
@@ -121,6 +121,11 @@ fn main() {
Err(why) => println!("Command '{}' returned error {:?}", command_name, why),
}
})
+ // Set a function that's called whenever an attempted command-call's
+ // command could not be found.
+ .unrecognised_command(|_, _, unknown_command_name| {
+ println!("Could not find command named '{}'", unknown_command_name);
+ })
// Set a function that's called whenever a command's execution didn't complete for one
// reason or another. For example, when a user has exceeded a rate-limit or a command
// can only be performed by the bot owner.