send a message to "bots" when not reacting to their messages
This commit is contained in:
11
urlbot.py
11
urlbot.py
@@ -4,9 +4,7 @@
|
|||||||
The URLBot - ready to strive for desaster in YOUR jabber MUC
|
The URLBot - ready to strive for desaster in YOUR jabber MUC
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from common import (
|
from common import (
|
||||||
rate_limit_classes,
|
rate_limit_classes,
|
||||||
RATE_GLOBAL,
|
RATE_GLOBAL,
|
||||||
@@ -24,7 +22,6 @@ from plugins import (
|
|||||||
register_event,
|
register_event,
|
||||||
else_command
|
else_command
|
||||||
)
|
)
|
||||||
|
|
||||||
import config
|
import config
|
||||||
|
|
||||||
|
|
||||||
@@ -32,6 +29,7 @@ class UrlBot(IdleBot):
|
|||||||
"""
|
"""
|
||||||
The URLBot, doing things the IdleBot wouldn't dare to.
|
The URLBot, doing things the IdleBot wouldn't dare to.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, jid, password, rooms, nick):
|
def __init__(self, jid, password, rooms, nick):
|
||||||
super(UrlBot, self).__init__(jid, password, rooms, nick)
|
super(UrlBot, self).__init__(jid, password, rooms, nick)
|
||||||
|
|
||||||
@@ -165,6 +163,11 @@ class UrlBot(IdleBot):
|
|||||||
# return
|
# return
|
||||||
if msg_obj['type'] == 'groupchat':
|
if msg_obj['type'] == 'groupchat':
|
||||||
if msg_obj['mucnick'] in config.runtimeconf_get("other_bots", ()):
|
if msg_obj['mucnick'] in config.runtimeconf_get("other_bots", ()):
|
||||||
|
msg_obj['type'] = 'chat'
|
||||||
|
self.send_reply("You're flagged as bot, please write {}: remove-from-botlist "
|
||||||
|
"{} if you're not a bot.".format(
|
||||||
|
config.conf_get('bot_nickname'), msg_obj['mucnick']
|
||||||
|
), msg_obj)
|
||||||
self.logger.debug("not talking to the other bot named {}".format(msg_obj['mucnick']))
|
self.logger.debug("not talking to the other bot named {}".format(msg_obj['mucnick']))
|
||||||
return False
|
return False
|
||||||
self.send_message(
|
self.send_message(
|
||||||
@@ -319,7 +322,7 @@ class UrlBot(IdleBot):
|
|||||||
self.show = presence.get('status')
|
self.show = presence.get('status')
|
||||||
|
|
||||||
self.send_presence(pstatus=self.status, pshow=self.show)
|
self.send_presence(pstatus=self.status, pshow=self.show)
|
||||||
# self.reconnect(wait=True)
|
# self.reconnect(wait=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user