Add echo support.
This commit is contained in:
parent
3ed2869a2f
commit
c9d444c93f
@ -93,7 +93,8 @@ class SyncBot(Tox):
|
|||||||
msg = '%s> %s' % rx.groups()
|
msg = '%s> %s' % rx.groups()
|
||||||
content = rx.group(2)
|
content = rx.group(2)
|
||||||
|
|
||||||
if content == '^syncbot':
|
if content == '^syncbot' or \
|
||||||
|
content == '^echobot':
|
||||||
self.irc.send('PRIVMSG %s :%s\r\n' %
|
self.irc.send('PRIVMSG %s :%s\r\n' %
|
||||||
(CHANNEL, self.get_address()))
|
(CHANNEL, self.get_address()))
|
||||||
elif content[1:].startswith('ACTION '):
|
elif content[1:].startswith('ACTION '):
|
||||||
@ -150,6 +151,8 @@ class SyncBot(Tox):
|
|||||||
if message == 'invite':
|
if message == 'invite':
|
||||||
print('Inviting %s' % self.get_name(friendid))
|
print('Inviting %s' % self.get_name(friendid))
|
||||||
self.invite_friend(friendid, self.tox_group_id)
|
self.invite_friend(friendid, self.tox_group_id)
|
||||||
|
else:
|
||||||
|
self.ensure_exe(self.send_message, (friendid, message))
|
||||||
|
|
||||||
t = SyncBot()
|
t = SyncBot()
|
||||||
t.loop()
|
t.loop()
|
||||||
|
Loading…
Reference in New Issue
Block a user