Skip to content

Command

Trevor Sears edited this page Jan 6, 2020 · 2 revisions

Table of Contents

Command

An interface representing the basic form of an executable command.

Type Parameters:

  • C
  • N
interface Command<C extends CommandStructure, N extends string = string> { ... }

#getName

Returns the name of the Command.

Parameters:

  • None

Returns the name of the Command.

getName(): N;

#execute

Executes the Command with the provided parameters and within the provided context, returning the resulting value.

Parameters:

  • params The parameters with which to execute this Command.
  • context The CommandSocket context with which to execute this Command.

Returns The return value of the executed Command.

execute(params: C["params"], context: CommandSocket): Promise<C["return"]>;
Clone this wiki locally