summaryrefslogtreecommitdiffstats
path: root/modules/search.py
diff options
context:
space:
mode:
authorSean B. Palmer <http://inamidst.com/sbp/>2008-04-26 15:54:35 +0100
committerSean B. Palmer <http://inamidst.com/sbp/>2008-04-26 15:54:35 +0100
commit986953131d1e399a9b277984a2234cd0c5f7656c (patch)
treebabe5d30a618c40b059421b43a9ca19b9b1beb14 /modules/search.py
parent286d4a8497621d2f3c0f1f8d66db60b11c87fad5 (diff)
downloadbot-986953131d1e399a9b277984a2234cd0c5f7656c.tar.gz
bot-986953131d1e399a9b277984a2234cd0c5f7656c.tar.bz2
bot-986953131d1e399a9b277984a2234cd0c5f7656c.zip
Allow the user to configure the port in the config, and other fixes.
Diffstat (limited to 'modules/search.py')
-rwxr-xr-xmodules/search.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/search.py b/modules/search.py
index fbd6596..1c8dad6 100755
--- a/modules/search.py
+++ b/modules/search.py
@@ -19,6 +19,7 @@ def json(text):
if r_json.match(r_string.sub('', text)):
text = r_string.sub(lambda m: 'u' + m.group(1), text)
return eval(text.strip(' \t\r\n'), env, {})
+ print text
raise ValueError('Input must be serialised JSON.')
def search(query, n=1):
@@ -55,6 +56,9 @@ def g(phenny, input):
uri = result(query)
if uri:
phenny.reply(uri)
+ if not hasattr(phenny.bot, 'last_seen_uri'):
+ phenny.bot.last_seen_uri = {}
+ phenny.bot.last_seen_uri[input.sender] = uri
else: phenny.reply("No results found for '%s'." % query)
g.commands = ['g']
g.priority = 'high'