make syncbot reponse to irc message ^syncbot and return it's address

This commit is contained in:
AZ Huang 2013-12-04 15:18:35 +08:00
parent da91a1ad18
commit dc94d1607c

View File

@ -81,7 +81,12 @@ class SyncBot(Tox):
if rx: if rx:
print('IRC> %s: %s' % rx.groups()) print('IRC> %s: %s' % rx.groups())
msg = '%s> %s' % rx.groups() msg = '%s> %s' % rx.groups()
self.send_group_msg(msg)
if rx.group(2) == '^syncbot':
self.irc.send('PRIVMSG %s :%s\r\n' %
(CHANNEL, self.get_address()))
else:
self.send_group_msg(msg)
l = line.rstrip().split() l = line.rstrip().split()
if l[0] == "PING": if l[0] == "PING":