Class: PluginContainer

PluginContainer(stateFile)

Datastructure to facilitate managing multiple plugins.

Constructor

new PluginContainer(stateFile)

Parameters:
Name Type Description
stateFile String location where the state file should be saved
Source:

Members

persistentStates :object.<String, Boolean>

object containing [String, Boolean] pairs to store which plugins are persistently enabled
Type:
  • object.<String, Boolean>
Source:

Methods

add(plugin)

Add a plugin to the container.
Parameters:
Name Type Description
plugin Plugin the plugin to add
Source:

startPlugin(identifier, persistent)

Start a plugin by a given plugin identifier.
Parameters:
Name Type Description
identifier String the plugin's identifier
persistent Boolean true if the plugin should run after a bot restart
Source:

startPlugins()

Start all plugins besides those that were disabled by an entry in the persistentStates object.
Source:

stopPlugin(identifier, persistent)

Stop a plugin by a given plugin identifier.
Parameters:
Name Type Description
identifier String the plugin's identifier
persistent Boolean true if the plugin shouldn't run after a bot restart
Source:

stopPlugins()

Stop all currently running plugins.
Source: