diff options
| author | 2018-10-03 17:01:10 +0100 | |
|---|---|---|
| committer | 2018-10-03 17:01:10 +0100 | |
| commit | 02e76444d17f02e152411d6ceafd43e0e2e68cae (patch) | |
| tree | 2bfdc5e6fac3a2bd6bc9a2fa47336257d04b448f /modules/commands.py | |
| parent | Correctly get BitBot's own modes in modules/print_activity.py (diff) | |
| signature | ||
Add 'remove_empty' kwarg for commands, to strip out empty space
Diffstat (limited to 'modules/commands.py')
| -rw-r--r-- | modules/commands.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/commands.py b/modules/commands.py index 3660beb7..fbe4eb23 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -140,7 +140,11 @@ class Module(ModuleManager.BaseModule): stderr.write(returned).send() target.buffer.skip_next() return + args_split = event["message_split"][args_index:] + if hook.kwargs.get("remove_empty", True): + args_split = list(filter(None, args_split)) + min_args = hook.kwargs.get("min_args") if min_args and len(args_split) < min_args: if "usage" in hook.kwargs: |
