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')