lib/protonbot/bot.rb in protonbot-0.3.6 vs lib/protonbot/bot.rb in protonbot-0.3.7

- old
+ new

@@ -1,8 +1,8 @@ # Main bot class. Use it to create the bot class ProtonBot::Bot - attr_reader :log, :_log, :dbs, :plugins, :conf, :plugs, :plugthrs, :core + attr_reader :log, :_log, :dbs, :plugins, :conf, :plugs, :plugthrs, :core, :db_cross # @yield Main bot's block. You'll use it for configuring bot. def initialize(&block) @_log = ProtonBot::Log.new @log = @_log.wrap('main') @@ -13,18 +13,20 @@ @conf = {} configure @log.info('Processed config block') + Dir.mkdir('dbs/') unless File.exist?(File.expand_path('./dbs/')) + @db_cross = Heliodor::DB.new("dbs/pb-cross.db", true) + @parr = [] @plugins = {} plugins_load @log.info('Processed plugins block') @dbs = {} @plugs = {} @plugthrs = {} - Dir.mkdir('dbs/') unless File.exist?(File.expand_path('./dbs/')) @conf['servers'].each do |k_, v_| k = k_.clone v = v_.clone @dbs[k] = Heliodor::DB.new("dbs/#{k}.db", true) unless k.nil? @plugs[k] = ProtonBot::Plug.new(self, k.clone, v.clone)