-
Notifications
You must be signed in to change notification settings - Fork 9
Command
Felix44 edited this page Aug 24, 2021
·
1 revision
This class is used for creating commands, for making them callable by the user they should be an element of the Commands Object
Commands.commandname = new Command("description", (message, args) => {}, "category", [], "link")
Constructor:
-
description(string): the description of the command, will be shown by&help -
action(function: Messagemessage, arrayargs): this function will be called when the command is called, the message and an array of the arguments are given as the function arguments -
category(string): the category of the command, commands with the same category will be in the same field when using&help, if omitted or undefined the command won't appear in the command list -
requiredArgs(array): an array that should contain RequiredArg objects -
link(string): a link to a page, will appear as a button when using&helpfor this command, used for some minigames (Reversi, MineSweeper, ecc..)
Methods:
-
call(Messagemessage, arrayargs): will attempt to call this command, it will first check all the required args, and then call the functionaction