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=[]):