Skip to content

Plugins.js Documentation

Josh edited this page Jul 9, 2024 · 4 revisions

Plugins.js allows you to interact with leo and Meower from your plugin easier through simple functions.

Functions

plugins

Functions related to plugins. All changes require a reload to take effect.

disable

Disables the specified plugin. Returns an error if specified plugin is not enabled or does not exist.

Accepts pluginName (string, required) and reload (boolean) parameters

Example usage

plugins.disable("plugin name", true) - Disables plugin and reloads

plugins.disable("plugin name", false) - Disables plugin but does not reload

enable

Enables the specified plugin. Any name can be specified but only valid plugin names will load upon reload. This will likely change in the future.

Accepts pluginName (string, required) and reload (boolean) parameters

Example usage

plugins.enable("plugin name", true) - Enables plugin and reloads

plugins.enable("plugin name", false) - Enables plugin but does not reload

test

Returns a test message to confirm Plugins.js is loaded and working.

Example usage

plugins.test()

client

Returns the client Plugins.js is loaded on

Example usage

plugins.client()

settings

Functions related to changing settings on leo. Dangerous account actions (deleting account, changing password, clearing tokens etc) cannot be made through Plugins.js for security reasons. List of settings can be found here.

disable

Disables the specified setting. Returns an error if specified setting does not exist.

Accepts settingName (string, required) parameter

Example usage

settings.disable("setting name") - Disables specified setting

enable

Enables the specified setting. Returns an error if specified setting does not exist.

Accepts settingName (string, required) parameter

Example usage

settings.enable("setting name") - Enables specified setting

Clone this wiki locally