diff options
| author | Austin Hellyer <[email protected]> | 2016-11-06 13:18:56 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-06 13:18:56 -0800 |
| commit | feb2ee1eddc92cf02fc9e64534030ae0d374418b (patch) | |
| tree | 301d5b1dea97cf797aeb3e94772b1973a68cac9a /examples/06_command_framework.rs | |
| parent | Allow non-prefixed mentions (diff) | |
| download | serenity-feb2ee1eddc92cf02fc9e64534030ae0d374418b.tar.xz serenity-feb2ee1eddc92cf02fc9e64534030ae0d374418b.zip | |
Add an 'allow_whitespace' framework config
The option allows whitespace to be optional between a mention and a
command.
Setting it to true will allow the following scenario to occur, while
false will not:
```
<@BOT_ID>about
// bot process and executes the "about" command if it exists
```
Diffstat (limited to 'examples/06_command_framework.rs')
| -rw-r--r-- | examples/06_command_framework.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/06_command_framework.rs b/examples/06_command_framework.rs index 21b8539..1bd3ffd 100644 --- a/examples/06_command_framework.rs +++ b/examples/06_command_framework.rs @@ -28,6 +28,7 @@ fn main() { client.with_framework(|f| f .configure(|c| c .on_mention(true) + .allow_whitespace(true) .prefix("~")) .on("ping", ping_command) .set_check("ping", owner_check) // Ensure only the owner can run this |