summaryrefslogtreecommitdiff
path: root/data/rbot/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins')
-rw-r--r--data/rbot/plugins/autoop.rb2
-rw-r--r--data/rbot/plugins/autorejoin.rb2
-rw-r--r--data/rbot/plugins/bash.rb2
-rw-r--r--data/rbot/plugins/chanserv.rb2
-rw-r--r--data/rbot/plugins/debugger.rb6
-rw-r--r--data/rbot/plugins/delicious.rb8
-rw-r--r--data/rbot/plugins/dice.rb2
-rw-r--r--data/rbot/plugins/dict.rb4
-rw-r--r--data/rbot/plugins/dictclient.rb14
-rw-r--r--data/rbot/plugins/figlet.rb2
-rw-r--r--data/rbot/plugins/fish.rb4
-rw-r--r--data/rbot/plugins/fortune.rb2
-rw-r--r--data/rbot/plugins/games/quiz.rb4
-rw-r--r--data/rbot/plugins/games/roulette.rb6
-rw-r--r--data/rbot/plugins/imdb.rb10
-rw-r--r--data/rbot/plugins/keywords.rb6
-rw-r--r--data/rbot/plugins/lastfm.rb4
-rw-r--r--data/rbot/plugins/linkbot.rb4
-rw-r--r--data/rbot/plugins/nickserv.rb14
-rw-r--r--data/rbot/plugins/ri.rb2
-rw-r--r--data/rbot/plugins/rss.rb8
-rw-r--r--data/rbot/plugins/salut.rb4
-rw-r--r--data/rbot/plugins/search.rb8
-rw-r--r--data/rbot/plugins/translator.rb4
-rw-r--r--data/rbot/plugins/unicode.rb4
-rw-r--r--data/rbot/plugins/url.rb12
26 files changed, 70 insertions, 70 deletions
diff --git a/data/rbot/plugins/autoop.rb b/data/rbot/plugins/autoop.rb
index 212da27b..303e3d3f 100644
--- a/data/rbot/plugins/autoop.rb
+++ b/data/rbot/plugins/autoop.rb
@@ -1,5 +1,5 @@
class AutoOP < Plugin
- BotConfig.register BotConfigBooleanValue.new('autoop.on_nick',
+ Config.register Config::BooleanValue.new('autoop.on_nick',
:default => true,
:desc => "Determines if the bot should auto-op when someone changes nick and the new nick matches a listed netmask")
diff --git a/data/rbot/plugins/autorejoin.rb b/data/rbot/plugins/autorejoin.rb
index fde8827c..14a2f29c 100644
--- a/data/rbot/plugins/autorejoin.rb
+++ b/data/rbot/plugins/autorejoin.rb
@@ -1,5 +1,5 @@
class AutoRejoinPlugin < Plugin
- BotConfig.register BotConfigBooleanValue.new('rejoin.insult',
+ Config.register Config::BooleanValue.new('rejoin.insult',
:default => true,
:desc => "Determines if the bot will insult whoever kicked it, after rejoin")
diff --git a/data/rbot/plugins/bash.rb b/data/rbot/plugins/bash.rb
index cb33a4d4..0524204a 100644
--- a/data/rbot/plugins/bash.rb
+++ b/data/rbot/plugins/bash.rb
@@ -57,7 +57,7 @@ end
class BashPlugin < Plugin
- BotConfig.register BotConfigEnumValue.new('bash.access',
+ Config.register Config::EnumValue.new('bash.access',
:values => ['xml', 'html'], :default => 'html',
:desc => "Which method the bot should use to access bash.org quotes: xml files or standard webpages")
diff --git a/data/rbot/plugins/chanserv.rb b/data/rbot/plugins/chanserv.rb
index c3e99207..7dcd1f3f 100644
--- a/data/rbot/plugins/chanserv.rb
+++ b/data/rbot/plugins/chanserv.rb
@@ -15,7 +15,7 @@
class ChanServPlugin < Plugin
- BotConfig.register BotConfigStringValue.new('chanserv.name',
+ Config.register Config::StringValue.new('chanserv.name',
:default => "chanserv", :requires_restart => false,
:desc => "Name of the chan server (all lowercase)")
diff --git a/data/rbot/plugins/debugger.rb b/data/rbot/plugins/debugger.rb
index fe000324..c83aea4a 100644
--- a/data/rbot/plugins/debugger.rb
+++ b/data/rbot/plugins/debugger.rb
@@ -8,13 +8,13 @@
# License:: GPL v2
class DebugPlugin < Plugin
- BotConfig.register BotConfigIntegerValue.new('debug.interval',
+ Config.register Config::IntegerValue.new('debug.interval',
:default => 10, :validate => Proc.new{|v| v > 0},
:desc => "Number of seconds between memory profile dumps")
- BotConfig.register BotConfigBooleanValue.new('debug.dump_strings',
+ Config.register Config::BooleanValue.new('debug.dump_strings',
:default => false,
:desc => "Set to true if you want the profiler to dump strings, false otherwise")
- BotConfig.register BotConfigStringValue.new('debug.logdir',
+ Config.register Config::StringValue.new('debug.logdir',
:default => "",
:desc => "Directory where profile/string dumps are to be stored")
diff --git a/data/rbot/plugins/delicious.rb b/data/rbot/plugins/delicious.rb
index bf678303..61ba0091 100644
--- a/data/rbot/plugins/delicious.rb
+++ b/data/rbot/plugins/delicious.rb
@@ -18,13 +18,13 @@ class DeliciousPlugin < Plugin
attr_accessor :last_error
- BotConfig.register BotConfigStringValue.new('delicious.user',
+ Config.register Config::StringValue.new('delicious.user',
:default => '', :desc => "Username on del.icio.us")
- BotConfig.register BotConfigStringValue.new('delicious.password',
+ Config.register Config::StringValue.new('delicious.password',
:default => '', :desc => "Password on del.icio.us")
- BotConfig.register BotConfigStringValue.new('delicious.user_fmt',
+ Config.register Config::StringValue.new('delicious.user_fmt',
:default => 'user:%s', :desc => "How to convert users to tags?")
- BotConfig.register BotConfigStringValue.new('delicious.channel_fmt',
+ Config.register Config::StringValue.new('delicious.channel_fmt',
:default => 'channel:%s', :desc => "How to convert channels to tags?")
def help(plugin, topic="")
diff --git a/data/rbot/plugins/dice.rb b/data/rbot/plugins/dice.rb
index ab40aa28..2cf49675 100644
--- a/data/rbot/plugins/dice.rb
+++ b/data/rbot/plugins/dice.rb
@@ -34,7 +34,7 @@ class DiceDisplay
end
class DicePlugin < Plugin
- BotConfig.register BotConfigIntegerValue.new('dice.max_dices',
+ Config.register Config::IntegerValue.new('dice.max_dices',
:default => 100, :validate => Proc.new{|v| v > 0},
:desc => "Maximum number of dices to throw.")
diff --git a/data/rbot/plugins/dict.rb b/data/rbot/plugins/dict.rb
index 95d9fe2e..dc52dbd9 100644
--- a/data/rbot/plugins/dict.rb
+++ b/data/rbot/plugins/dict.rb
@@ -22,10 +22,10 @@ DEMAURO_LEMMA = /<anchor>(.*?)(?: - (.*?))<go href="lemma.php\?ID=(\d+)"\/><\/an
CHAMBERS_LEMMA = /<p><span class="hwd">(.*?)<\/span> <span class="psa">(.*?)<\/span>(.*?)<\/p>/
class DictPlugin < Plugin
- BotConfig.register BotConfigIntegerValue.new('dict.hits',
+ Config.register Config::IntegerValue.new('dict.hits',
:default => 3,
:desc => "Number of hits to return from a dictionary lookup")
- BotConfig.register BotConfigIntegerValue.new('dict.first_par',
+ Config.register Config::IntegerValue.new('dict.first_par',
:default => 0,
:desc => "When set to n > 0, the bot will return the first paragraph from the first n dictionary hits")
diff --git a/data/rbot/plugins/dictclient.rb b/data/rbot/plugins/dictclient.rb
index 910583ff..2fcdf05a 100644
--- a/data/rbot/plugins/dictclient.rb
+++ b/data/rbot/plugins/dictclient.rb
@@ -52,25 +52,25 @@ class ::Definition
end
class DictClientPlugin < Plugin
- BotConfig.register BotConfigStringValue.new('dictclient.server',
+ Config.register Config::StringValue.new('dictclient.server',
:default => 'dict.org',
:desc => _('Hostname or hostname:port of the DICT server used to lookup words'))
- BotConfig.register BotConfigIntegerValue.new('dictclient.max_defs_before_collapse',
+ Config.register Config::IntegerValue.new('dictclient.max_defs_before_collapse',
:default => 4,
:desc => _('When multiple databases reply a number of definitions that above this limit, only the database names will be listed. Otherwise, the full definitions from each database are replied'))
- BotConfig.register BotConfigIntegerValue.new('dictclient.max_length_per_def',
+ Config.register Config::IntegerValue.new('dictclient.max_length_per_def',
:default => 200,
:desc => _('Each definition is truncated to this length'))
- BotConfig.register BotConfigStringValue.new('dictclient.headword_format',
+ Config.register Config::StringValue.new('dictclient.headword_format',
:default => "#{Bold}<headword>#{Bold}",
:desc => _('Format of headwords; <word> will be replaced with the actual word'))
- BotConfig.register BotConfigStringValue.new('dictclient.database_format',
+ Config.register Config::StringValue.new('dictclient.database_format',
:default => "#{Underline}<database>#{Underline}",
:desc => _('Format of database names; <database> will be replaced with the database name'))
- BotConfig.register BotConfigStringValue.new('dictclient.definition_format',
+ Config.register Config::StringValue.new('dictclient.definition_format',
:default => '<headword>: <definition> -<database>',
:desc => _('Format of definitions. <word> will be replaced with the formatted headword, <def> will be replaced with the truncated definition, and <database> with the formatted database name'))
- BotConfig.register BotConfigStringValue.new('dictclient.match_format',
+ Config.register Config::StringValue.new('dictclient.match_format',
:default => '<matches>––<database>',
:desc => _('Format of match results. <matches> will be replaced with the formatted headwords, <database> with the formatted database name'))
diff --git a/data/rbot/plugins/figlet.rb b/data/rbot/plugins/figlet.rb
index b84a8521..eb218edf 100644
--- a/data/rbot/plugins/figlet.rb
+++ b/data/rbot/plugins/figlet.rb
@@ -2,7 +2,7 @@ class FigletPlugin < Plugin
DEFAULT_FONTS = ['rectangles', 'smslant']
MAX_WIDTH=68
- BotConfig.register BotConfigStringValue.new('figlet.path',
+ Config.register Config::StringValue.new('figlet.path',
:default => '/usr/bin/figlet',
:desc => _('Path to the figlet program'))
diff --git a/data/rbot/plugins/fish.rb b/data/rbot/plugins/fish.rb
index 7cefff8b..3bafd03e 100644
--- a/data/rbot/plugins/fish.rb
+++ b/data/rbot/plugins/fish.rb
@@ -1,10 +1,10 @@
class BabelPlugin < Plugin
LANGS = %w{en fr de it pt es nl ru zh zt el ja ko}
- BotConfig.register BotConfigEnumValue.new('translate.default_from',
+ Config.register Config::EnumValue.new('translate.default_from',
:values => LANGS, :default => 'en',
:desc => "Default language to translate from")
- BotConfig.register BotConfigEnumValue.new('translate.default_to',
+ Config.register Config::EnumValue.new('translate.default_to',
:values => LANGS, :default => 'en',
:desc => "Default language to translate to")
diff --git a/data/rbot/plugins/fortune.rb b/data/rbot/plugins/fortune.rb
index 2845a8c8..adb6a839 100644
--- a/data/rbot/plugins/fortune.rb
+++ b/data/rbot/plugins/fortune.rb
@@ -4,7 +4,7 @@
# :title: Fortune plugin
class FortunePlugin < Plugin
- BotConfig.register BotConfigStringValue.new('fortune.path',
+ Config.register Config::StringValue.new('fortune.path',
:default => '',
:desc => "Full path to the fortune executable")
diff --git a/data/rbot/plugins/games/quiz.rb b/data/rbot/plugins/games/quiz.rb
index 5f7392da..37602fba 100644
--- a/data/rbot/plugins/games/quiz.rb
+++ b/data/rbot/plugins/games/quiz.rb
@@ -156,11 +156,11 @@ end
# CLASS QuizPlugin
#######################################################################
class QuizPlugin < Plugin
- BotConfig.register BotConfigBooleanValue.new('quiz.dotted_nicks',
+ Config.register Config::BooleanValue.new('quiz.dotted_nicks',
:default => true,
:desc => "When true, nicks in the top X scores will be camouflaged to prevent IRC hilighting")
- BotConfig.register BotConfigArrayValue.new('quiz.sources',
+ Config.register Config::ArrayValue.new('quiz.sources',
:default => ['quiz.rbot'],
:desc => "List of files and URLs that will be used to retrieve quiz questions")
diff --git a/data/rbot/plugins/games/roulette.rb b/data/rbot/plugins/games/roulette.rb
index 7c25a6cc..adf755fd 100644
--- a/data/rbot/plugins/games/roulette.rb
+++ b/data/rbot/plugins/games/roulette.rb
@@ -1,13 +1,13 @@
define_structure :RouletteHistory, :games, :shots, :deaths, :misses, :wins
class RoulettePlugin < Plugin
- BotConfig.register BotConfigBooleanValue.new('roulette.autospin',
+ Config.register Config::BooleanValue.new('roulette.autospin',
:default => true,
:desc => "Automatically spins the roulette at the butlast shot")
- BotConfig.register BotConfigBooleanValue.new('roulette.kick',
+ Config.register Config::BooleanValue.new('roulette.kick',
:default => false,
:desc => "Kicks shot players from the channel")
- BotConfig.register BotConfigBooleanValue.new('roulette.twice_in_a_row',
+ Config.register Config::BooleanValue.new('roulette.twice_in_a_row',
:default => false,
:desc => "Allow players to go twice in a row")
diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb
index 58684a72..84d0bb17 100644
--- a/data/rbot/plugins/imdb.rb
+++ b/data/rbot/plugins/imdb.rb
@@ -376,19 +376,19 @@ class Imdb
end
class ImdbPlugin < Plugin
- BotConfig.register BotConfigBooleanValue.new('imdb.aka',
+ Config.register Config::BooleanValue.new('imdb.aka',
:default => true,
:desc => "Look for IMDB matches also in translated titles and other 'also known as' information")
- BotConfig.register BotConfigBooleanValue.new('imdb.popular',
+ Config.register Config::BooleanValue.new('imdb.popular',
:default => true,
:desc => "Display info on popular IMDB entries matching the request closely")
- BotConfig.register BotConfigBooleanValue.new('imdb.exact',
+ Config.register Config::BooleanValue.new('imdb.exact',
:default => true,
:desc => "Display info on IMDB entries matching the request exactly")
- BotConfig.register BotConfigBooleanValue.new('imdb.fix_article',
+ Config.register Config::BooleanValue.new('imdb.fix_article',
:default => false,
:desc => "Try to detect an article placed at the end and move it in front of the title")
- BotConfig.register BotConfigBooleanValue.new('imdb.tv_series_in_movies',
+ Config.register Config::BooleanValue.new('imdb.tv_series_in_movies',
:default => false,
:desc => "Whether searching movies by person/year should also return TV series")
diff --git a/data/rbot/plugins/keywords.rb b/data/rbot/plugins/keywords.rb
index 6ace2016..c2054e3b 100644
--- a/data/rbot/plugins/keywords.rb
+++ b/data/rbot/plugins/keywords.rb
@@ -79,13 +79,13 @@ end
# handle it, checks for a keyword command or lookup, otherwise the message
# is delegated to plugins
class Keywords < Plugin
- BotConfig.register BotConfigBooleanValue.new('keyword.listen',
+ Config.register Config::BooleanValue.new('keyword.listen',
:default => false,
:desc => "Should the bot listen to all chat and attempt to automatically detect keywords? (e.g. by spotting someone say 'foo is bar')")
- BotConfig.register BotConfigBooleanValue.new('keyword.address',
+ Config.register Config::BooleanValue.new('keyword.address',
:default => true,
:desc => "Should the bot require that keyword lookups are addressed to it? If not, the bot will attempt to lookup foo if someone says 'foo?' in channel")
- BotConfig.register BotConfigIntegerValue.new('keyword.search_results',
+ Config.register Config::IntegerValue.new('keyword.search_results',
:default => 3,
:desc => "How many search results to display at a time")
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb
index 8c562055..8f25dd4f 100644
--- a/data/rbot/plugins/lastfm.rb
+++ b/data/rbot/plugins/lastfm.rb
@@ -36,10 +36,10 @@ class ::LastFmEvent
end
class LastFmPlugin < Plugin
- BotConfig.register BotConfigIntegerValue.new('lastfm.max_events',
+ Config.register Config::IntegerValue.new('lastfm.max_events',
:default => 25, :validate => Proc.new{|v| v > 1},
:desc => "Maximum number of events to display.")
- BotConfig.register BotConfigIntegerValue.new('lastfm.default_events',
+ Config.register Config::IntegerValue.new('lastfm.default_events',
:default => 3, :validate => Proc.new{|v| v > 1},
:desc => "Default number of events to display.")
diff --git a/data/rbot/plugins/linkbot.rb b/data/rbot/plugins/linkbot.rb
index a922883f..3c2f42b7 100644
--- a/data/rbot/plugins/linkbot.rb
+++ b/data/rbot/plugins/linkbot.rb
@@ -22,11 +22,11 @@
# servers to make this even easier.
class LinkBot < Plugin
- BotConfig.register BotConfigArrayValue.new('linkbot.nicks',
+ Config.register Config::ArrayValue.new('linkbot.nicks',
:default => [],
:desc => "Nick(s) of the bots that act as channel links across networks")
- BotConfig.register BotConfigArrayValue.new('linkbot.message_patterns',
+ Config.register Config::ArrayValue.new('linkbot.message_patterns',
:default => ['^<(\S+?)@(\S+?)>\s+(.*)$', '^\((\S+?)@(\S+?)\)\s+(.*)$'],
:desc => "List of regexp which match linkbot messages; each regexp needs to have three captures, which in order are the nickname of the original speaker, network, and original message")
# TODO use template strings instead of regexp for user friendliness
diff --git a/data/rbot/plugins/nickserv.rb b/data/rbot/plugins/nickserv.rb
index b89e61d9..87688952 100644
--- a/data/rbot/plugins/nickserv.rb
+++ b/data/rbot/plugins/nickserv.rb
@@ -21,30 +21,30 @@
class NickServPlugin < Plugin
- BotConfig.register BotConfigStringValue.new('nickserv.name',
+ Config.register Config::StringValue.new('nickserv.name',
:default => "nickserv", :requires_restart => false,
:desc => "Name of the nick server (all lowercase)")
- BotConfig.register BotConfigStringValue.new('nickserv.ident_request',
+ Config.register Config::StringValue.new('nickserv.ident_request',
:default => "IDENTIFY", :requires_restart => false,
:on_change => Proc.new { |bot, v| bot.plugins.delegate "set_ident_request", v },
:desc => "String to look for to see if the nick server is asking us to identify")
- BotConfig.register BotConfigStringValue.new('nickserv.nick_avail',
+ Config.register Config::StringValue.new('nickserv.nick_avail',
:default => "not (currently )?online|killed|recovered|disconnesso|libero",
:requires_restart => false,
:on_change => Proc.new { |bot, v| bot.plugins.delegate "set_nick_avail", v },
:desc => "String to look for to see if the nick server is informing us that our nick is now available")
- BotConfig.register BotConfigStringValue.new('nickserv.identified_string',
+ Config.register Config::StringValue.new('nickserv.identified_string',
:default => "(Password|Contrase|Mot de passe).+(acce[pt]t|r[ie]cog?n).+(identif|r[ie]cog?n)",
:requires_restart => false,
:on_change => Proc.new { |bot, v| bot.plugins.delegate "set_identified_string", v },
:desc => "String to look for to see if the nick server is informing us that we have identified successfully")
- BotConfig.register BotConfigBooleanValue.new('nickserv.wants_nick',
+ Config.register Config::BooleanValue.new('nickserv.wants_nick',
:default => false, :requires_restart => false,
:desc => "Set to false if the nick server doesn't expect the nick as a parameter in the identify command")
- BotConfig.register BotConfigIntegerValue.new('nickserv.wait',
+ Config.register Config::IntegerValue.new('nickserv.wait',
:default => 30, :validate => Proc.new { |v| v > 0 }, :requires_restart => false,
:desc => "Seconds to wait after sending a message to nickserv, e.g. after ghosting")
@@ -64,7 +64,7 @@ class NickServPlugin < Plugin
end
def genpasswd
- return Irc::Auth.random_password
+ return Irc::Bot::Auth.random_password
end
def set_ident_request(val)
diff --git a/data/rbot/plugins/ri.rb b/data/rbot/plugins/ri.rb
index 1c4cc84d..763dd658 100644
--- a/data/rbot/plugins/ri.rb
+++ b/data/rbot/plugins/ri.rb
@@ -16,7 +16,7 @@ class RiPlugin < Plugin
RI_COMMAND = %w{ri -f simple -T}
- BotConfig.register BotConfigIntegerValue.new('ri.max_length',
+ Config.register Config::IntegerValue.new('ri.max_length',
:default => 512,
:desc => "Maximum length of ri entry (in bytes) which is ok to be sent to channels or other users")
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index 6ee93404..5a87e789 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -242,19 +242,19 @@ class ::RssBlob
end
class RSSFeedsPlugin < Plugin
- BotConfig.register BotConfigIntegerValue.new('rss.head_max',
+ Config.register Config::IntegerValue.new('rss.head_max',
:default => 100, :validate => Proc.new{|v| v > 0 && v < 200},
:desc => "How many characters to use of a RSS item header")
- BotConfig.register BotConfigIntegerValue.new('rss.text_max',
+ Config.register Config::IntegerValue.new('rss.text_max',
:default => 200, :validate => Proc.new{|v| v > 0 && v < 400},
:desc => "How many characters to use of a RSS item text")
- BotConfig.register BotConfigIntegerValue.new('rss.thread_sleep',
+ Config.register Config::IntegerValue.new('rss.thread_sleep',
:default => 300, :validate => Proc.new{|v| v > 30},
:desc => "How many seconds to sleep before checking RSS feeds again")
- BotConfig.register BotConfigBooleanValue.new('rss.show_updated',
+ Config.register Config::BooleanValue.new('rss.show_updated',
:default => true,
:desc => "Whether feed items for which the description was changed should be shown as new")
diff --git a/data/rbot/plugins/salut.rb b/data/rbot/plugins/salut.rb
index feff2dd6..2948b2f3 100644
--- a/data/rbot/plugins/salut.rb
+++ b/data/rbot/plugins/salut.rb
@@ -14,12 +14,12 @@
# TODO:: *REMEMBER* to set @changed to true after edit or changes won't be saved
class SalutPlugin < Plugin
- BotConfig.register BotConfigBooleanValue.new('salut.all_languages',
+ Config.register Config::BooleanValue.new('salut.all_languages',
:default => true,
:desc => "Check for a salutation in all languages and not just in the one defined by core.language",
:on_change => Proc.new {|bot, v| bot.plugins['salut'].reload}
)
- BotConfig.register BotConfigBooleanValue.new('salut.address_only',
+ Config.register Config::BooleanValue.new('salut.address_only',
:default => true,
:desc => "When set to true, the bot will only reply to salutations directed at him",
:on_change => Proc.new {|bot, v| bot.plugins['salut'].reload}
diff --git a/data/rbot/plugins/search.rb b/data/rbot/plugins/search.rb
index 493db936..46aa46fe 100644
--- a/data/rbot/plugins/search.rb
+++ b/data/rbot/plugins/search.rb
@@ -22,16 +22,16 @@ GOOGLE_CALC_RESULT = %r{<p><table><tr><td><img src=/images/calc_img\.gif(?: alt=
GOOGLE_DEF_RESULT = %r{<p> (Web definitions for .*?)<br/>(.*?)<br/>(.*?)\s-\s+<a href}
class SearchPlugin < Plugin
- BotConfig.register BotConfigIntegerValue.new('google.hits',
+ Config.register Config::IntegerValue.new('google.hits',
:default => 3,
:desc => "Number of hits to return from Google searches")
- BotConfig.register BotConfigIntegerValue.new('google.first_par',
+ Config.register Config::IntegerValue.new('google.first_par',
:default => 0,
:desc => "When set to n > 0, the bot will return the first paragraph from the first n search hits")
- BotConfig.register BotConfigIntegerValue.new('wikipedia.hits',
+ Config.register Config::IntegerValue.new('wikipedia.hits',
:default => 3,
:desc => "Number of hits to return from Wikipedia searches")
- BotConfig.register BotConfigIntegerValue.new('wikipedia.first_par',
+ Config.register Config::IntegerValue.new('wikipedia.first_par',
:default => 1,
:desc => "When set to n > 0, the bot will return the first paragraph from the first n wikipedia search hits")
diff --git a/data/rbot/plugins/translator.rb b/data/rbot/plugins/translator.rb
index 299d6a0e..6a842754 100644
--- a/data/rbot/plugins/translator.rb
+++ b/data/rbot/plugins/translator.rb
@@ -252,7 +252,7 @@ class WorldlingoTranslator < Translator
end
class TranslatorPlugin < Plugin
- BotConfig.register BotConfigIntegerValue.new('translator.timeout',
+ Config.register Config::IntegerValue.new('translator.timeout',
:default => 30, :validate => Proc.new{|v| v > 0},
:desc => _("Number of seconds to wait for the translation service before timeout"))
@@ -279,7 +279,7 @@ class TranslatorPlugin < Plugin
end
end
- BotConfig.register BotConfigArrayValue.new('translator.default_list',
+ Config.register Config::ArrayValue.new('translator.default_list',
:default => TRANSLATORS.keys,
:validate => Proc.new {|l| l.all? {|t| TRANSLATORS.has_key?(t)}},
:desc => _("List of translators to try in order when translator name not specified"),
diff --git a/data/rbot/plugins/unicode.rb b/data/rbot/plugins/unicode.rb
index e05f87dd..957f5bff 100644
--- a/data/rbot/plugins/unicode.rb
+++ b/data/rbot/plugins/unicode.rb
@@ -18,12 +18,12 @@ require 'jcode'
require 'iconv'
class UnicodePlugin < Plugin
- BotConfig.register BotConfigBooleanValue.new(
+ Config.register Config::BooleanValue.new(
'encoding.enable', :default => true,
:desc => "Support for non-ascii charsets",
:on_change => Proc.new { |bot, v| reconfigure_filter(bot) })
- BotConfig.register BotConfigArrayValue.new(
+ Config.register Config::ArrayValue.new(
'encoding.charsets', :default => ['utf-8', 'cp1252', 'iso-8859-15'],
:desc => "Ordered list of iconv(3) charsets the bot should try",
:on_change => Proc.new { |bot, v| reconfigure_filter(bot) })
diff --git a/data/rbot/plugins/url.rb b/data/rbot/plugins/url.rb
index 16b2e28e..e3cecb6b 100644
--- a/data/rbot/plugins/url.rb
+++ b/data/rbot/plugins/url.rb
@@ -13,22 +13,22 @@ class UrlPlugin < Plugin
LINK_INFO = "[Link Info]"
OUR_UNSAFE = Regexp.new("[^#{URI::PATTERN::UNRESERVED}#{URI::PATTERN::RESERVED}%# ]", false, 'N')
- BotConfig.register BotConfigIntegerValue.new('url.max_urls',
+ Config.register Config::IntegerValue.new('url.max_urls',
:default => 100, :validate => Proc.new{|v| v > 0},
:desc => "Maximum number of urls to store. New urls replace oldest ones.")
- BotConfig.register BotConfigIntegerValue.new('url.display_link_info',
+ Config.register Config::IntegerValue.new('url.display_link_info',
:default => 0,
:desc => "Get the title of links pasted to the channel and display it (also tells if the link is broken or the site is down). Do it for at most this many links per line (set to 0 to disable)")
- BotConfig.register BotConfigBooleanValue.new('url.titles_only',
+ Config.register Config::BooleanValue.new('url.titles_only',
:default => false,
:desc => "Only show info for links that have <title> tags (in other words, don't display info for jpegs, mpegs, etc.)")
- BotConfig.register BotConfigBooleanValue.new('url.first_par',
+ Config.register Config::BooleanValue.new('url.first_par',
:default => false,
:desc => "Also try to get the first paragraph of a web page")
- BotConfig.register BotConfigBooleanValue.new('url.info_on_list',
+ Config.register Config::BooleanValue.new('url.info_on_list',
:default => false,
:desc => "Show link info when listing/searching for urls")
- BotConfig.register BotConfigArrayValue.new('url.no_info_hosts',
+ Config.register Config::ArrayValue.new('url.no_info_hosts',
:default => ['localhost', '^192\.168\.', '^10\.', '^127\.', '^172\.(1[6-9]|2\d|31)\.'],
:on_change => Proc.new { |bot, v| bot.plugins['url'].reset_no_info_hosts },
:desc => "A list of regular expressions matching hosts for which no info should be provided")