From ba3cd00c785921dc3150510d889cc2373f8757b3 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 16 Oct 2018 14:47:01 +0100 Subject: Add utils.EventError, utilise it for stderr in commands.py/coins.py --- modules/commands.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'modules/commands.py') diff --git a/modules/commands.py b/modules/commands.py index 0f22c2d8..66fc6202 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -165,12 +165,15 @@ class Module(ModuleManager.BaseModule): args = " ".join(args_split) server = event["server"] user = event["user"] - self.events.on("received.command").on(command - ).call_limited(1, user=user, server=server, - target=target, args=args, - args_split=args_split, stdout=stdout, stderr=stderr, - command=command.lower(), is_channel=is_channel, - tags=event["tags"]) + try: + self.events.on("received.command").on(command + ).call_unsafe_limited(1, user=user, server=server, + target=target, args=args, tags=event["tags"], + args_split=args_split, stdout=stdout, stderr=stderr, + command=command.lower(), is_channel=is_channel) + except EventManager.EventError as e: + stdout.write(str(e)) + if not hook.kwargs.get("skip_out", False): stdout.send() stderr.send() -- cgit v1.3.1-10-gc9f91