From 29377922d3d79848efcb8d3bd0fbd52c21e81c5d Mon Sep 17 00:00:00 2001 From: Lakelezz <12222135+Lakelezz@users.noreply.github.com> Date: Thu, 15 Feb 2018 13:44:10 +0100 Subject: Add `unrecognised_command` (#276) --- examples/05_command_framework/src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'examples/05_command_framework/src') 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. -- cgit v1.2.3