+ # Returns +true+ if _name_ is a known botmodule of class kl
+ def knows?(name, kl)
+ return @commandmappers[kl.to_sym].has_key?(name.to_sym)
+ end
+
+ # Registers botmodule _botmodule_ with command _cmd_ and command path _auth_path_
+ def register(botmodule, cmd, auth_path)
+ raise TypeError, "First argument #{botmodule.inspect} is not of class BotModule" unless botmodule.kind_of?(BotModule)
+ kl = botmodule.botmodule_class
+ @commandmappers[kl.to_sym][cmd.to_sym] = {:botmodule => botmodule, :auth => auth_path}
+ h = @commandmappers[kl.to_sym][cmd.to_sym]
+ # debug "Registered command mapper for #{cmd.to_sym} (#{kl.to_sym}): #{h[:botmodule].name} with command path #{h[:auth]}"
+ end
+
+ def add_botmodule(botmodule)
+ raise TypeError, "Argument #{botmodule.inspect} is not of class BotModule" unless botmodule.kind_of?(BotModule)
+ kl = botmodule.botmodule_class
+ raise "#{kl.to_s} #{botmodule.name} already registered!" if @botmodules[kl.to_sym].include?(botmodule)
+ @botmodules[kl.to_sym] << botmodule
+ end
+
+ # Returns an array of the loaded plugins
+ def core_modules
+ @botmodules[:coremodule]
+ end
+
+ # Returns an array of the loaded plugins