]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/message.rb
Sun Aug 07 15:11:07 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
[user/henk/code/ruby/rbot.git] / lib / rbot / message.rb
index d7f614ab7b884c12c96fc2070126fb548c389d6f..ba5dcb43885f2e4ac4c8592a9c4af128002d46a6 100644 (file)
@@ -1,4 +1,8 @@
 module Irc
+  BotConfig.register BotConfigArrayValue.new('core.address_prefix',
+    :default => [], :wizard => true,
+    :desc => "what non nick-matching prefixes should the bot respond to as if addressed (e.g !, so that '!foo' is treated like 'rbot: foo')"
+  )
 
   # base user message class, all user messages derive from this
   # (a user message is defined as having a source hostmask, a target
@@ -127,7 +131,7 @@ module Irc
 
       # check for option extra addressing prefixes, e.g "|search foo", or
       # "!version" - first match wins
-      bot.addressing_prefixes.each {|mprefix|
+      bot.config['core.address_prefix'].each {|mprefix|
         if @message.gsub!(/^#{Regexp.escape(mprefix)}\s*/, "")
           @address = true
           break