From edef2704ce1ea1f839ee03cc396cab8530de7046 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 22 May 2009 17:52:34 +0200 Subject: 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'. --- data/rbot/plugins/factoids.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3