diff options
| author | Lakelezz <[email protected]> | 2018-02-15 13:44:10 +0100 |
|---|---|---|
| committer | alex <[email protected]> | 2018-02-15 13:44:10 +0100 |
| commit | 29377922d3d79848efcb8d3bd0fbd52c21e81c5d (patch) | |
| tree | 1dc4510a96dcfc7322e6e2418bf46d21ee7d5041 /examples/05_command_framework | |
| parent | Add 'Get Guild Vanity Url' endpoint (diff) | |
| download | serenity-29377922d3d79848efcb8d3bd0fbd52c21e81c5d.tar.xz serenity-29377922d3d79848efcb8d3bd0fbd52c21e81c5d.zip | |
Add `unrecognised_command` (#276)
Diffstat (limited to 'examples/05_command_framework')
| -rw-r--r-- | examples/05_command_framework/src/main.rs | 5 |
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. |