summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/factoids.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-05-22 17:52:34 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-05-22 17:52:34 +0200
commitedef2704ce1ea1f839ee03cc396cab8530de7046 (patch)
tree84679b060fd18381d63252bcb5ec7624324b39fb /data/rbot/plugins/factoids.rb
parent7f244f32d974cafa74f449853f940f194d08d6d2 (diff)
factoids: fix error message when no fact is found
When the search is called as 'facts search' the 'words' parameter is not defined, so customize the message depending on wether we have that or 'rx'.
Diffstat (limited to 'data/rbot/plugins/factoids.rb')
-rw-r--r--data/rbot/plugins/factoids.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/data/rbot/plugins/factoids.rb b/data/rbot/plugins/factoids.rb
index 0970684f..ba6e8845 100644
--- a/data/rbot/plugins/factoids.rb
+++ b/data/rbot/plugins/factoids.rb
@@ -349,7 +349,11 @@ class FactoidsPlugin < Plugin
known = @factoids.grep(rx)
reply = []
if known.empty?
- reply << _("I know nothing about %{words}" % params)
+ if params.key? :words
+ reply << _("I know nothing about %{words}" % params)
+ else params.key? :rx
+ reply << _("I know nothing matching %{rx}" % params)
+ end
else
max_facts = @bot.config['factoids.search_results']
len = known.length