Only buffer.skip() for non-regex commands

This commit is contained in:
jesopo 2019-05-19 17:34:14 +01:00
parent bf6e4a0e40
commit db3525778e

View file

@ -140,8 +140,6 @@ class Module(ModuleManager.BaseModule):
if hook.kwargs.get("remove_empty", True): if hook.kwargs.get("remove_empty", True):
args_split = list(filter(None, args_split)) args_split = list(filter(None, args_split))
target.buffer.skip_next()
min_args = hook.kwargs.get("min_args") min_args = hook.kwargs.get("min_args")
if min_args and len(args_split) < min_args: if min_args and len(args_split) < min_args:
command_prefix = "" command_prefix = ""
@ -234,6 +232,7 @@ class Module(ModuleManager.BaseModule):
self.command(event["server"], event["channel"], True, self.command(event["server"], event["channel"], True,
event["user"], command, args_split, event["tags"], event["user"], command, args_split, event["tags"],
"".join(event["statusmsg"]), hook) "".join(event["statusmsg"]), hook)
target.buffer.skip_next()
else: else:
regex_hook = self.events.on("command.regex").get_hooks() regex_hook = self.events.on("command.regex").get_hooks()
for hook in regex_hook: for hook in regex_hook:
@ -262,6 +261,7 @@ class Module(ModuleManager.BaseModule):
self.command(event["server"], event["user"], False, self.command(event["server"], event["user"], False,
event["user"], command, event["message_split"][1:], event["user"], command, event["message_split"][1:],
event["tags"], "", hook) event["tags"], "", hook)
target.buffer.skip_next()
def _get_help(self, hook): def _get_help(self, hook):
return hook.get_kwarg("help", None) or hook.docstring.description return hook.get_kwarg("help", None) or hook.docstring.description