SockBot
Main Module for SockBot2.0
Author: Accalia
License: MIT
SockBot.prepare(configuration, callback)
Prepare the bot for running
Kind: static method of SockBot
Param | Type | Description |
---|---|---|
configuration | object | string |
Configuration to use. If string interpret as file path to read from |
callback | preparedCallback |
Completion callback |
SockBot.start(callback)
Start the bot
Kind: static method of SockBot
Param | Type | Description |
---|---|---|
callback | completedCallback |
Completion Callback |
SockBot.stop(callback)
Stop the event loop and signal plugins to stop
Kind: static method of SockBot
Param | Type | Description |
---|---|---|
callback | function |
Completion callback |
SockBot.logMessage(message)
Log a message to console
Kind: static method of SockBot
Param | Type | Description |
---|---|---|
message | * |
Message to log |
SockBot.logWarning(warning)
Log a warning to console
Kind: static method of SockBot
Param | Type | Description |
---|---|---|
warning | * |
Message to log |
SockBot.logError(error)
Log an error to console
Kind: static method of SockBot
Param | Type | Description |
---|---|---|
error | * |
Message to log |
SockBot~doPluginRequire(module, requireIt) ⇒ object
Load module as plugin
Kind: inner method of SockBot
Returns: object
- requested module
Param | Type | Description |
---|---|---|
module | string |
Module to require |
requireIt | function |
nodejs core require function (for unti testing purposes is parameter) |
SockBot~prepareEvents(callback)
Prepare core EventEmitter as a SockEvents object
Kind: inner method of SockBot
Param | Type | Description |
---|---|---|
callback | preparedCallback |
Completion callback |
SockBot~loadPlugins()
Load plugins based on current configuration.
Kind: inner method of SockBot
SockBot~loadConfig(cfg, callback)
Load configuration
Kind: inner method of SockBot
Param | Type | Description |
---|---|---|
cfg | string | object |
Configuration to use, if string load as filepath to configuration |
callback | completedCallback |
CompletionCallback |
SockBot~preparedCallback
Prepared Callback
Kind: inner typedef of SockBot
Param | Type | Description |
---|---|---|
err | string | Error |
Any Error encountered |
events | external.events.SockEvents |
SockBot's internal event emitter with added helper functions |
pluginBrowser | browser |
discourse communication class, will be logged into discourse once bot starts |
SockBot~completedCallback
Completion Callback
Kind: inner typedef of SockBot
Param | Type | Description |
---|---|---|
err | string | Error |
Any Error encountered |