aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-15 13:26:11 +0000
committerGravatar jesopo2019-11-15 13:26:11 +0000
commit6a55b14afaa529621cf49c374009565b191a6b5d (patch)
treed426f3910fb83f3f5a487230e014d5ed39d87681 /modules
parentwe should be passing `args` in to _find_command_hook, not `args_split` (diff)
signature
only try to shlex when we know we've found a command hook
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/__init__.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py
index ea136536..d48a58a8 100644
--- a/modules/commands/__init__.py
+++ b/modules/commands/__init__.py
@@ -99,6 +99,7 @@ class Module(ModuleManager.BaseModule):
return None, None, None
hook = None
+ args_split = []
channel_skip = False
private_skip = False
if self.has_command(command):
@@ -122,17 +123,18 @@ class Module(ModuleManager.BaseModule):
continue
hook = potential_hook
+
+ argparse = hook.get_kwarg("argparse", "plain")
+ if argparse == "shlex":
+ args_split = shlex.split(args)
+ elif argparse == "plain":
+ args_split = args.split(" ")
+
break
if not hook and (private_skip or channel_skip):
raise BadContextException("channel" if channel_skip else "private")
- argparse = hook.get_kwarg("argparse", "plain")
- if argparse == "shlex":
- args_split = shlex.split(args)
- elif argparse == "plain":
- args_split = args.split(" ")
-
return hook, command, args_split
def _check(self, context, kwargs, requests=[]):