Class: Config

Config

new Config(message_obj)

Represents configuration.
Parameters:
Name Type Description
message_obj Message
Author:
Source:

Methods

getConfig()

Returns the config value for asked keys.
Source:

getConfigFromDb(fn)

Fetches latest config copy from db.
Parameters:
Name Type Description
fn function callback
Source:

getGlobals()

Returns globals so that new config object can be created on spawned process.
Source:

pullConfig(fn)

This pulls config from db and if config is not set display warning and stops bot.
Parameters:
Name Type Description
fn function callback
Source:

setDB(p)

Sets the db object.
Parameters:
Name Type Description
p MongoDB
Source:

setOverridenConfig()

Overrides the db and local config with command line arguments. Writes the overriden config to disk. Reloades config for current instance.
Source:

updateDbConfig(dic, fn)

Updates the config in the db for current bot.
Parameters:
Name Type Description
dic Object config
fn function callback
Source:

(inner) configReloader()

This function is called in an interval to fetch and compare config. If config is changed from db it restart the bot.
Source:

(private, inner) msg()

Used to call Logger object with the caller function name.
Source:

(private, inner) setDbConfig(dic)

Adds db config from db_config.json to config var.
Parameters:
Name Type Description
dic Object db config
Source: