Members
- core
Current core configuration
Set by internals. Do not edit
- plugins
Current plugin configuration
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 withoutrequire
ingutils
itself- user
Current logged in user
Set by internals. Do not edit
Constants
- defaultConfig :
object
Default configuration options
Functions
- readFile(path, callback)
Read and parse configuration file from disc
- loadConfiguration(path, 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
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 require
ing utils
itself
Kind: global variable
Returns: object
- object constructed by merging mixin
s 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 :
object
- .core :
object
- .username :
string
- .password :
string
- .owner :
string
- .forum :
string
- .ignoreUsers :
Array.<string>
- .ignoreCategories :
Array.<Number>
- .cooldownPeriod :
Number
- .handleActedMessage :
boolean
- .pollMessages :
boolean
- .pollNotifications :
boolean
- .username :
- .plugins :
object
- .core :
defaultConfig.core : object
Core configuration options
Kind: static property of defaultConfig
- .core :
object
- .username :
string
- .password :
string
- .owner :
string
- .forum :
string
- .ignoreUsers :
Array.<string>
- .ignoreCategories :
Array.<Number>
- .cooldownPeriod :
Number
- .handleActedMessage :
boolean
- .pollMessages :
boolean
- .pollNotifications :
boolean
- .username :
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
defaultConfig.plugins : object
Plugin configuration.
See Plugin Configuration
for details
Kind: static property of defaultConfig
readFile(path, callback)
Read and parse configuration file from disc
Kind: global function
Param | Type | Description |
---|---|---|
path | string |
Path of file to read |
callback | configComplete |
Completion callback |
loadConfiguration(path, callback)
Load configuration from disc
Kind: global function
Param | Type | Description |
---|---|---|
path | 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 |