From d75998312865eabd2c28562e6ab96f919540b1a6 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 21 Nov 2007 22:18:40 +0000 Subject: factoids plugin: config value for number of search results --- data/rbot/plugins/factoids.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/rbot/plugins/factoids.rb b/data/rbot/plugins/factoids.rb index f2dbeeaf..0b0913a3 100644 --- a/data/rbot/plugins/factoids.rb +++ b/data/rbot/plugins/factoids.rb @@ -94,6 +94,9 @@ class FactoidsPlugin < Plugin Config.register Config::BooleanValue.new('factoids.address', :default => true, :desc => "Should the bot reply with relevant factoids only when addressed with a direct question? If not, the bot will attempt to lookup foo if someone says 'foo?' in channel") + Config.register Config::IntegerValue.new('factoids.search_results', + :default => 5, + :desc => "How many factoids to display at a time") def initialize super @@ -288,8 +291,7 @@ class FactoidsPlugin < Plugin if known.empty? reply << _("I know nothing about %{words}" % params) else - # TODO config - max_facts = 5 + max_facts = @bot.config['factoids.search_results'] len = known.length if len > max_facts m.reply _("%{len} out of %{total} facts refer to %{words}, I'll only show %{max}" % { -- cgit v1.2.3