Add color coding.
This commit is contained in:
parent
b5ad3dccd5
commit
f16590f4ed
1 changed files with 4 additions and 1 deletions
|
@ -151,6 +151,8 @@ class SyncBot(Tox):
|
||||||
name = self.group_peername(groupnumber, friendgroupnumber)
|
name = self.group_peername(groupnumber, friendgroupnumber)
|
||||||
if name != NAME:
|
if name != NAME:
|
||||||
print('TOX> %s: %s' % (name, message))
|
print('TOX> %s: %s' % (name, message))
|
||||||
|
if message.startswith('>'):
|
||||||
|
message = '\x0309%s\03' % 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)
|
||||||
|
@ -161,8 +163,9 @@ class SyncBot(Tox):
|
||||||
def on_group_action(self, groupnumber, friendgroupnumber, action):
|
def on_group_action(self, groupnumber, friendgroupnumber, action):
|
||||||
name = self.group_peername(groupnumber, friendgroupnumber)
|
name = self.group_peername(groupnumber, friendgroupnumber)
|
||||||
if name != NAME:
|
if name != NAME:
|
||||||
name = self.group_peername(groupnumber, friendgroupnumber)
|
|
||||||
print('TOX> %s: %s' % (name, action))
|
print('TOX> %s: %s' % (name, action))
|
||||||
|
if action.startswith('>'):
|
||||||
|
action = '\x0309%s\03' % 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))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue