Add a static-factoid for !google, also make sure supybot.plugins.Encyclopedia.ignores can override the other static-factoids.

++inline-doc
This commit is contained in:
Terence Simpson 2011-02-01 07:33:52 +00:00
parent b6adc54a42
commit edf17bfbb5

View File

@ -468,17 +468,20 @@ class Encyclopedia(callbacks.Plugin):
ret = ''
retmsg = ''
term = self.get_target(msg.nick, orig_text, target)
if term[0] == "search":
if term[0] == "search": # Usage info for the !search command
ret = "Search factoids for term: !search <term>"
retmsg = term[2]
elif term[0] == "seen" or term[0].startswith("seen "):
elif beginswith(lower_text, self.registryValue('ignores', channel)): # Make sure ignores can ignore these built-in "facts"
return
elif term[0] == "seen" or term[0].startswith("seen "): # Some people expect a '!seen <nick>' command
ret = "I have no seen command"
retmsg = term[2] and "%s: " % msg.prefix.split('!', 1)[0] or ''
retmsg = term[2] and "%s: " % msg.prefix.split('!', 1)[0] or '' # Redirect back at the caller, rather than the target
elif term[0] == "google" or term[0].startswith("google "): # Some poeple expect a '!google <term...>' command
ret = "I have no google command, use http://www.google.com/"
retmsg = term[2] and "%s: " % msg.prefix.split('!', 1)[0] or '' # Redirect back at the caller, rather than the taget
elif term[0] in ("what", "whats", "what's") or term[0].startswith("what ") or term[0].startswith("what ") or term[0].startswith("whats ") or term[0].startswith("what's "): # Try and catch people saying "ubottu: what is ...?"
ret = "I am only a bot, please don't think I'm intelligent :)"
retmsg = term[2]
elif beginswith(lower_text, self.registryValue('ignores', channel)):
return
else:
# Lookup, search or edit?
if lower_text.startswith('search '):