]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/core/config.rb
Fix small typo in basics core botmodule
[user/henk/code/ruby/rbot.git] / lib / rbot / core / config.rb
index 7eda780f4536a69d4113ae22570957dc3d3abf19..dfbaaab66d05fb5da16c4ba3ac2d202aff60f59c 100644 (file)
@@ -4,6 +4,10 @@
 \r
 class ConfigModule < CoreBotModule\r
 \r
+  def save\r
+    @bot.config.save\r
+  end\r
+\r
   def handle_list(m, params)\r
     modules = []\r
     if params[:module]\r
@@ -18,7 +22,7 @@ class ConfigModule < CoreBotModule
         m.reply modules.join(", ")\r
       end\r
     else\r
-      @bot.configitems.each_key do |key|\r
+      @bot.config.items.each_key do |key|\r
         name = key.to_s.split('.').first\r
         modules.push name unless modules.include?(name)\r
       end\r
@@ -85,7 +89,7 @@ class ConfigModule < CoreBotModule
       m.reply "no such config key #{key}"\r
       return\r
     end\r
-    unless @bot.config.items[key].class <= BotConfigArrayValue\r
+    unless @bot.config.items[key].kind_of?(BotConfigArrayValue)\r
       m.reply "config key #{key} is not an array"\r
       return\r
     end\r
@@ -107,7 +111,7 @@ class ConfigModule < CoreBotModule
       m.reply "no such config key #{key}"\r
       return\r
     end\r
-    unless @bot.config.items[key].class <= BotConfigArrayValue\r
+    unless @bot.config.items[key].kind_of?(BotConfigArrayValue)\r
       m.reply "config key #{key} is not an array"\r
       return\r
     end\r
@@ -132,7 +136,7 @@ class ConfigModule < CoreBotModule
     @bot.save\r
     m.reply "rescanning ..."\r
     @bot.rescan\r
-    m.reply "done. #{@plugins.status(true)}"\r
+    m.reply "done. #{@bot.plugins.status(true)}"\r
   end\r
 \r
   def bot_nick(m, param)\r
@@ -158,7 +162,7 @@ class ConfigModule < CoreBotModule
     m.reply help(params[:topic])\r
   end\r
 \r
-  def help(topic="")\r
+  def help(plugin, topic="")\r
     case topic\r
     when "list"\r
       "config list => list configuration modules, config list <module> => list configuration keys for module <module>"\r