diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py index 598da563..8af9231d 100644 --- a/modules/commands/__init__.py +++ b/modules/commands/__init__.py @@ -157,6 +157,7 @@ def command(self, server, target, target_str, is_channel, user, command, command_method = self._command_method(target, server) ret = False + had_out = False if hook.kwargs.get("remove_empty", True): args_split = list(filter(None, args_split)) @@ -211,6 +212,7 @@ def command(self, server, target, target_str, is_channel, user, command, stderr.write(str(e)) if not hook.kwargs.get("skip_out", False): + had_out = stdout.has_text() or stderr.has_text() command_method = self._command_method(target, server) stdout.send(command_method) stderr.send(command_method) @@ -218,8 +220,7 @@ def command(self, server, target, target_str, is_channel, user, command, target.last_stderr = stderr ret = new_event.eaten - if (expect_output and message_tags and not stdout.has_text() and - not stderr.has_text()): + if expect_output and message_tags and not had_out: server.send(utils.irc.protocol.tagmsg(target_str, {"+draft/typing": "done"}), immediate=True)