Skip to content

Creating your first command

Domas edited this page Jan 11, 2020 · 1 revision

To create a command, you have to define it by using registerCommand function.

chat.registerCommand(commandName, callback, requiredArgumentAmount, commandDescription, commandUsage);
Argument Description
commandName: string Sets name for a command which will be used to call it.
callback: function Function which will be called.
requiredArgumentAmount: int How many arguments are required.
commandDescription: string Text which will be used to describe command's functionality.
commandUsage: string Arguments in a text form which will be used to help people understand what arguments does this command needs.

You will find examples in /chat/server/index.mjs file

Clone this wiki locally