From 750ffa71b962873754a2ac835f79e64151384033 Mon Sep 17 00:00:00 2001 From: AZ Huang Date: Sun, 1 Dec 2013 23:24:33 +0800 Subject: [PATCH] need to respond to ping --- tox-irc-sync.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tox-irc-sync.py b/tox-irc-sync.py index 21e93c1..cfcad0e 100644 --- a/tox-irc-sync.py +++ b/tox-irc-sync.py @@ -62,8 +62,8 @@ class SyncBot(Tox): checked = False if not self.joined: - tid = self.get_friend_id(GROUP_BOT) try: + tid = self.get_friend_id(GROUP_BOT) self.send_message(tid, 'invite') except: pass @@ -85,6 +85,10 @@ class SyncBot(Tox): if self.tox_group_id != None: self.group_message_send(self.tox_group_id, msg) + l = line.rstrip().split() + if l[0] == "PING": + self.irc.send("PONG %s\r\n" % l[1]) + self.do() except KeyboardInterrupt: self.save_to_file('data')