From 3767263b4915f68f8390b78b0e78126aaa5b8956 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sun, 27 Dec 2015 00:10:28 +0100 Subject: [PATCH] fix command/parser bug II. --- urlbot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/urlbot.py b/urlbot.py index e50d312..c4e6103 100755 --- a/urlbot.py +++ b/urlbot.py @@ -166,8 +166,8 @@ class UrlBot(IdleBot): 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['from']._jid[2] - ), msg_obj) + config.conf_get('bot_nickname'), msg_obj['from']._jid[2] + ), msg_obj) self.logger.debug("not talking to the other bot named {}".format(msg_obj['from']._jid[2])) return False self.send_message( @@ -219,8 +219,8 @@ class UrlBot(IdleBot): reacted_on_command = self.data_parse_commands(msg_obj) reacted_on_parse = self.data_parse_other(msg_obj) - if not any([reacted_on_command, reacted_on_parse]) \ - and rate_limit(RATE_GLOBAL): + if (msg_obj['data'].startswith(config.conf_get('bot_nickname')) and not any( + [reacted_on_command, reacted_on_parse]) and rate_limit(RATE_GLOBAL)): ret = else_command({'reply_user': msg_obj['from']._jid[2]}) if ret: if 'msg' in ret: