diff options
| author | 2018-10-16 14:47:01 +0100 | |
|---|---|---|
| committer | 2018-10-16 14:47:01 +0100 | |
| commit | ba3cd00c785921dc3150510d889cc2373f8757b3 (patch) | |
| tree | 6318801dc8bc5af36414b0a5e259501c7413c530 /modules/commands.py | |
| parent | Typo in modules/coins.py.send(), 'target' -> 'target_user' (diff) | |
Add utils.EventError, utilise it for stderr in commands.py/coins.py
Diffstat (limited to 'modules/commands.py')
| -rw-r--r-- | modules/commands.py | 15 |
1 files changed, 9 insertions, 6 deletions
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() |
