From f43106d471e2c7317f7ee61242d2ffc5acf16765 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sat, 26 Dec 2015 23:17:22 +0100 Subject: [PATCH] send a message to "bots" when not reacting to their messages --- urlbot.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/urlbot.py b/urlbot.py index 1cd008f..7bfec83 100755 --- a/urlbot.py +++ b/urlbot.py @@ -4,9 +4,7 @@ The URLBot - ready to strive for desaster in YOUR jabber MUC """ import sys - import time - from common import ( rate_limit_classes, RATE_GLOBAL, @@ -24,7 +22,6 @@ from plugins import ( register_event, else_command ) - import config @@ -32,6 +29,7 @@ class UrlBot(IdleBot): """ The URLBot, doing things the IdleBot wouldn't dare to. """ + def __init__(self, jid, password, rooms, nick): super(UrlBot, self).__init__(jid, password, rooms, nick) @@ -165,6 +163,11 @@ class UrlBot(IdleBot): # return if msg_obj['type'] == 'groupchat': 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'])) return False self.send_message( @@ -319,7 +322,7 @@ class UrlBot(IdleBot): self.show = presence.get('status') self.send_presence(pstatus=self.status, pshow=self.show) - # self.reconnect(wait=True) + # self.reconnect(wait=True) if __name__ == '__main__':