def initialize(bot)
@@bot = bot
@handler = MessageMapper.new(self)
@handler.map 'config list :module', :action => 'handle_list',
:defaults => {:module => false}
@handler.map 'config get :key', :action => 'handle_get'
@handler.map 'config desc :key', :action => 'handle_desc'
@handler.map 'config describe :key', :action => 'handle_desc'
@handler.map 'config set :key *value', :action => 'handle_set'
@handler.map 'config add :value to :key', :action => 'handle_add'
@handler.map 'config rm :value from :key', :action => 'handle_rm'
@handler.map 'config del :value from :key', :action => 'handle_rm'
@handler.map 'config delete :value from :key', :action => 'handle_rm'
@handler.map 'config unset :key', :action => 'handle_unset'
@handler.map 'config reset :key', :action => 'handle_unset'
@handler.map 'config help :topic', :action => 'handle_help',
:defaults => {:topic => false}
@handler.map 'help config :topic', :action => 'handle_help',
:defaults => {:topic => false}
if(File.exist?("#{@@bot.botclass}/conf.yaml"))
begin
newconfig = YAML::load_file("#{@@bot.botclass}/conf.yaml")
newconfig.each { |key, val|
@@config[key.intern] = val
}
return
rescue
error "failed to read conf.yaml: #{$!}"
end
end
BotConfigWizard.new(@@bot).run
save
end