Skip to content

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:

  1. description (string): the description of the command, will be shown by &help
  2. action (function: Message message, array args): this function will be called when the command is called, the message and an array of the arguments are given as the function arguments
  3. 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
  4. requiredArgs (array): an array that should contain RequiredArg objects
  5. link (string): a link to a page, will appear as a button when using &help for this command, used for some minigames (Reversi, MineSweeper, ecc..)

Methods:

  • call (Message message, array args): will attempt to call this command, it will first check all the required args, and then call the function action

Classes:

Clone this wiki locally