summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/factoids.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-11-21 22:18:40 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-11-21 22:18:40 +0000
commitd75998312865eabd2c28562e6ab96f919540b1a6 (patch)
treec3945443cb9419d81250c976407134fe42ddbb55 /data/rbot/plugins/factoids.rb
parente7a0fa98cc6ca709be9b6f68ccd564a9ae502768 (diff)
factoids plugin: config value for number of search results
Diffstat (limited to 'data/rbot/plugins/factoids.rb')
-rw-r--r--data/rbot/plugins/factoids.rb6
1 files changed, 4 insertions, 2 deletions
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}" % {