Skip to content

Commit

Permalink
[search] Don't record last seen url if feature not enabled
Browse files Browse the repository at this point in the history
Closes #644
  • Loading branch information
embolalia committed Oct 25, 2014
1 parent f51915f commit f7d407d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions willie/modules/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def g(bot, trigger):
uri = google_search(query)
if uri:
bot.reply(uri)
bot.memory['last_seen_url'][trigger.sender] = uri
if 'last_seen_url' in bot.memory:
bot.memory['last_seen_url'][trigger.sender] = uri
elif uri is False:
bot.reply("Problem getting data from Google.")
else:
Expand Down Expand Up @@ -165,7 +166,8 @@ def duck(bot, trigger):

if uri:
bot.reply(uri)
bot.memory['last_seen_url'][trigger.sender] = uri
if 'last_seen_url' in bot.memory:
bot.memory['last_seen_url'][trigger.sender] = uri
else:
bot.reply("No results found for '%s'." % query)

Expand Down

0 comments on commit f7d407d

Please sign in to comment.