From d3f6f8e54525272c5f1e75dbf5904be702a93949 Mon Sep 17 00:00:00 2001 From: stal Date: Wed, 19 Feb 2014 17:53:56 -0800 Subject: [PATCH] Add greentext support lol --- tox-irc-sync.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tox-irc-sync.py b/tox-irc-sync.py index ec695ac..ab9a23c 100644 --- a/tox-irc-sync.py +++ b/tox-irc-sync.py @@ -147,12 +147,16 @@ class SyncBot(Tox): def on_group_message(self, groupnumber, friendgroupnumber, message): if message != self.sent: name = self.group_peername(groupnumber, friendgroupnumber) + if message.startswith('>'): + message = ('\0039%s\003' % message) print('TOX> %s: %s' % (name, message)) self.irc_send('PRIVMSG %s :%s> %s\r\n' % (CHANNEL, name, message)) def on_group_action(self, groupnumber, friendgroupnumber, action): if action != self.sent: name = self.group_peername(groupnumber, friendgroupnumber) + if action.startswith('>'): + action = ('\0039%s\003' % action) print('TOX> %s: %s' % (name, action)) self.irc_send('PRIVMSG %s :\x01ACTION %s> %s\x01\r\n' % (CHANNEL, name, action))