Members

core

Current core configuration

Set by internals. Do not edit

plugins

Current plugin configuration

Set by internals. Do not edit

basePath : string

Base Path of the active config file

Set by internals. Do not edit

mergeObjectsobject

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

user

Current logged in user

Set by internals. Do not edit

Constants

defaultConfig : object

Default configuration options

Functions

readFile(filePath, callback)

Read and parse configuration file from disc

loadConfiguration(filePath, callback)

Load configuration from disc

Typedefs

configComplete

Configuration Loaded Callback

core

Current core configuration

Set by internals. Do not edit

Kind: global variable
Read only: true

plugins

Current plugin configuration

Set by internals. Do not edit

Kind: global variable
Read only: true

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

user

Current logged in user

Set by internals. Do not edit

Kind: global variable
Read only: true

defaultConfig : object

Default configuration options

Kind: global constant
Read only: true

defaultConfig.core : object

Core configuration options

Kind: static property of defaultConfig

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"

core.ignoreUsers : Array.<string>

Users to ignore.

Ignoring users demotes them internally to virtual trust level 0. Forum staff cannot be ignored.

Kind: static property of core
Default: ["blakeyrat","PaulaBean"]

core.ignoreCategories : Array.<Number>

Discourse categories to ignore

Posts from ignored categories will not trigger bot.

Kind: static property of core
Default: [8,23]

core.cooldownPeriod : Number

Cooldown timer for users that map to virtual trust level 1 or lower

Kind: static property of core
Default: 3600000

core.handleActedMessage : boolean

Switch to handle acted type channel messages.

This type of message is often not needed for bot operation and generates a fair bit of traffic. Disabling reduces load on the host forum.

Kind: static property of core
Default: false

core.pollMessages : boolean

Set whether to poll for messages.

If the bot only needs to handle notifications, set this to false to reduce load on the host forum.

Note: Setting this to false will cause notifications to be polled less frequently; leave true if you want a more responsive bot

Kind: static property of core
Default: true

core.pollNotifications : boolean

Set whether to poll for notifications.

For bots, this will normally be left true. For cyberparts, set this to false to stop the bot marking notifications as read.

Kind: static property of core
Default: true

core.extendedLogLevel : boolean

Extended Logging Level.

Extended log messages will only be logged if they have a lower level than this value. omit or set to 0 to disable extended logging

Kind: static property of core
Default: 0

core.extendedLog : number | string

Extended Logging Destination.

Where to write extended log information. Can be stderr, or stdout` to write to the respective outputs, or a file path to append logs to, or if you are using input redirection to attach additional open file descriptors a number indicating the file descriptor to write to.

Kind: static property of core
Default: stderr

defaultConfig.plugins : object

Plugin configuration.

See Plugin Configuration for details

Kind: static property of defaultConfig

defaultConfig.basePath : string

Base Path of the active config file

Kind: static property of defaultConfig

readFile(filePath, callback)

Read and parse configuration file from disc

Kind: global function

Param Type Description
filePath string Path of file to read
callback configComplete Completion callback

loadConfiguration(filePath, callback)

Load configuration from disc

Kind: global function

Param Type Description
filePath string Configuration file path
callback configComplete Completion callback

configComplete

Configuration Loaded Callback

Kind: global typedef

Param Type Default Description
[err] Exception Error encountered processing request
config Object Loaded Configuration