Skip to content

Deveopment of Add ons

Agustin San Roman edited this page Jul 15, 2017 · 4 revisions

Add-ons are single-file scripts you can use to customize your bot. This scripts are loaded when they are installed and when the application is started.

There is not any restriction, so be careful, you can seriusly damage your bot if you install add-ons and you don't know what they do.

Example of add-on with commands:

/* Example of Add-on */

'use strict';

const commands = {
  alias: 'command',
	command: function () {
		this.pmReply("This is a test command!");
	}
};

exports.setup = function (App) {
	App.parser.addCommands(commands);
};

exports.destroy = function (App) {
	App.parser.removeCommands(commands);
};

Every add-on should have a setup mathod, called whren the add-on is installed, and a destroy method, called when the add-on is uninstalled. If an add-on does not have that methods, you must restart the application to remove the effects after unistalling it.

See also: Add-on template with all the options

If you are insterested in developing an add-on, you can use the basic development guide as help.