From 69e7bfce356d957d364c20ae8424430e7d1a4c06 Mon Sep 17 00:00:00 2001 From: Terence Simpson Date: Sat, 10 May 2008 16:47:49 +0100 Subject: [PATCH] Small edit to the code that detects when the bot is being addressed and returns a factoid --- Encyclopedia/plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Encyclopedia/plugin.py b/Encyclopedia/plugin.py index 4f11614..7e2330a 100644 --- a/Encyclopedia/plugin.py +++ b/Encyclopedia/plugin.py @@ -183,12 +183,12 @@ class Encyclopedia(callbacks.Plugin): if len(text) and text[0] == self.registryValue('prefixchar',channel=recipients): text = text[1:] if text.lower().startswith(irc.nick.lower()) and (len(text) < nlen or not text[nlen].isalnum()): - t2 = text[nlen:].strip() - if t2 and t2.find('>') != 0 and t2.find('|') != 0: - text = text[nlen:].strip() + t2 = text[nlen+1:].strip() + if t2 and t2.find('>') != -1 and t2.find('|') != -1: + text = text[nlen+1:].strip() return text if text.lower().startswith(irc.nick) and not text[nlen].isalnum(): - return text[nlen:] + return text[nlen+1:] return False else: # Private if text.strip()[0] in str(conf.supybot.reply.whenAddressedBy.chars):