diff --git a/redminebot.py b/redminebot.py index 6e3e773..38ac246 100755 --- a/redminebot.py +++ b/redminebot.py @@ -156,6 +156,13 @@ class Bot: if ready_to_read: last_read = datetime.utcnow() irc_msg = self.msg_handler() + + # If the server pings us then we've got to respond! + if irc_msg.find("PING :") != -1: + self.pong(irc_msg) + LOGGER.info("Responding to ping message: {}".format(irc_msg)) + continue + irc_msg, actor, channel = parse_irc_messages(irc_msg) if irc_msg is not None: @@ -208,10 +215,6 @@ class Bot: self._check_project_updates(channel) self.send_privmsg(channel, "Fait !") - # If the server pings us then we've got to respond! - if irc_msg.find("PING :") != -1: - self.pong(irc_msg) - # Responds to a user that inputs "Hello Mybot". def bot_hello(self, channel: str, greeting: str) -> None: self.send_privmsg(channel, greeting)