Members
- basePath :
string Base Path of the active config file
Set by internals. Do not edit
- mergeObjects ⇒
object Merge multiple objects into one object
Later objects override earlier objects
This is simply a reference to the function of the same name in
utils, exposed to allow plugins to call it withoutrequireingutilsitself
Constants
- defaultConfig :
object Default configuration options
Functions
- readYaml(filePath, callback) ⇒
Promise.<*> Read and parse configuration file from disc
- load(filePath) ⇒
Promise.<Array> Load configuration from disc
- validateConfig(config)
Validate a configuration entry
Typedefs
- configComplete
Configuration Loaded Callback
basePath : string
Base Path of the active config file
Set by internals. Do not edit
Kind: global variable
Read only: true
mergeObjects ⇒ object
Merge multiple objects into one object
Later objects override earlier objects
This is simply a reference to the function of the same name in utils,
exposed to allow plugins to call it without requireing utils itself
Kind: global variable
Returns: object - object constructed by merging mixins from left to right
| Param | Type | Description |
|---|---|---|
| [mergeArrays] | boolean |
Merge arrays instead of concatenating them |
| ...mixin | object |
Objects to merge |
defaultConfig : object
Default configuration options
Kind: global constant
Read only: true
- defaultConfig :
object
defaultConfig.core : object
Core configuration options
Kind: static property of defaultConfig
core.provider
Foum Provider
Kind: static property of core
core.username : string
Username the bot will log in as
Kind: static property of core
Default: ""
core.password : string
Password the bot will log in with
Kind: static property of core
Default: ""
core.owner : string
User the bot will consider owner
Owner promotes the user to virtual trust level 9 (above forum admins)
Kind: static property of core
Default: ""
core.forum : string
Base URL for the discourse instance to log into
Is case sensitive
Kind: static property of core
Default: "https://what.thedailywtf.com"
defaultConfig.plugins : object
Plugin configuration.
See Plugin Configuration for details
Kind: static property of defaultConfig
readYaml(filePath, callback) ⇒ Promise.<*>
Read and parse configuration file from disc
Kind: global function
Returns: Promise.<*> - Resolves tyo YAML parsed configuration file
| Param | Type | Description |
|---|---|---|
| filePath | string |
Path of file to read |
| callback | configComplete |
Completion callback |
load(filePath) ⇒ Promise.<Array>
Load configuration from disc
Kind: global function
Returns: Promise.<Array> - Resolves to an array of valid configuration entries
| Param | Type | Description |
|---|---|---|
| filePath | string |
Configuration file path |
validateConfig(config)
Validate a configuration entry
Kind: global function
Throws:
Errorusername,password, orowneris not a string of at least length 1
| Param | Type | Description |
|---|---|---|
| config | object |
Configuration entry to validate |
configComplete
Configuration Loaded Callback
Kind: global typedef
| Param | Type | Default | Description |
|---|---|---|---|
| [err] | Exception |
|
Error encountered processing request |
| config | Object |
Loaded Configuration |