From c9d444c93fbca063d2e190503f1949449c3de42b Mon Sep 17 00:00:00 2001 From: AZ Huang Date: Fri, 3 Jan 2014 03:41:35 +0800 Subject: [PATCH] Add echo support. --- tox-irc-sync.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tox-irc-sync.py b/tox-irc-sync.py index 0b17e79..0b1a8b2 100644 --- a/tox-irc-sync.py +++ b/tox-irc-sync.py @@ -93,7 +93,8 @@ class SyncBot(Tox): msg = '%s> %s' % rx.groups() content = rx.group(2) - if content == '^syncbot': + if content == '^syncbot' or \ + content == '^echobot': self.irc.send('PRIVMSG %s :%s\r\n' % (CHANNEL, self.get_address())) elif content[1:].startswith('ACTION '): @@ -150,6 +151,8 @@ class SyncBot(Tox): if message == 'invite': print('Inviting %s' % self.get_name(friendid)) self.invite_friend(friendid, self.tox_group_id) + else: + self.ensure_exe(self.send_message, (friendid, message)) t = SyncBot() t.loop()