From 65417b187a53b713346eba803295a4c642ba93e0 Mon Sep 17 00:00:00 2001 From: Thomas Mannay Date: Sat, 5 Nov 2016 20:27:12 +0000 Subject: [PATCH] Fix PING response --- seddy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seddy.py b/seddy.py index 36c42ab..610651d 100644 --- a/seddy.py +++ b/seddy.py @@ -92,6 +92,9 @@ if __name__ == "__main__": for line in receive: msg = parse_msg.search(line) if msg is None: + if 'PING' in line: + send.write('PONG\r\n') + send.flush() continue else: msg = msg.group(1) @@ -101,9 +104,6 @@ if __name__ == "__main__": if 'PRIVMSG' in line and not is_sed.match(msg): history.enqueue(msg) - if 'PING' in line: - send.write('PONG\r\n') - send.flush() if '.bots' in msg[:5] or '.bot ' + nick in msg[:5 + len(nick)]: notice("I was written to correct your mistakes.") if '.source ' + nick in msg[:8 + len(nick)]: