Class: Plugin

Plugin(identifier)

The base class to be extended by all bot plugins. It provides methods to facilitate the implementation of a plugin.

Constructor

new Plugin(identifier)

The identifier is used to identify plugin and to provide a location to store permanent data.
Parameters:
Name Type Description
identifier String the plugins unique identifier
Source:

Members

commandContainer :CommandContainer

A map that stores the commands for this plugin.
Type:
  • CommandContainer
Source:

identifier :String

The plugin's unique identifier.
Type:
  • String
Source:

(readonly) running :Boolean

True if the plugin is running.
Type:
  • Boolean
Source:

Methods

configFileLocation() → {String}

Get the configuration file path for this plugin.
Source:
Returns:
a relative path to the configuration file
Type
String

dataDirLocation() → {String}

Get the data directory for this plugin.
Source:
Returns:
a relative path without a trailing slash
Type
String

defaultConfig() → {Object}

Called to specify the default configuration parameters. The config object will not be loaded from the file if the default config returns null.
Source:
Returns:
a object containing the default configuration parameters or null if a config file is not needed
Type
Object

startPlugin()

Called when the plugin should be started. The client property is available when this method is called.
Source:

stopPlugin()

Called when the plugin should be stopped. The plugin must release the client instance.
Source: