Fix color bug.

This commit is contained in:
AZ Huang 2014-02-20 18:34:59 +00:00
parent f16590f4ed
commit 93a1f5ae7d

View File

@ -152,7 +152,7 @@ class SyncBot(Tox):
if name != NAME: if name != NAME:
print('TOX> %s: %s' % (name, message)) print('TOX> %s: %s' % (name, message))
if message.startswith('>'): if message.startswith('>'):
message = '\x0309%s\03' % message message = '\x0309%s\x03' % message
if message.startswith('^'): if message.startswith('^'):
self.irc_send('PRIVMSG %s :%s\r\n' % (CHANNEL, message)) self.irc_send('PRIVMSG %s :%s\r\n' % (CHANNEL, message))
self.handle_command(message) self.handle_command(message)
@ -165,7 +165,7 @@ class SyncBot(Tox):
if name != NAME: if name != NAME:
print('TOX> %s: %s' % (name, action)) print('TOX> %s: %s' % (name, action))
if action.startswith('>'): if action.startswith('>'):
action = '\x0309%s\03' % action action = '\x0309%s\x03' % action
self.irc_send('PRIVMSG %s :\x01ACTION [%s]: %s\x01\r\n' % self.irc_send('PRIVMSG %s :\x01ACTION [%s]: %s\x01\r\n' %
(CHANNEL, name, action)) (CHANNEL, name, action))