Skip to content

CommandInterface

Interface  ·  Sharkord\Commands\CommandInterface

Interface CommandInterface

Defines the contract that all bot commands must follow.

Retrieves the unique name of the command.

This name is used to invoke the command (e.g., “ping” for “!ping”).

Returns string — The command name.


Retrieves a brief description of what the command does.

Returns string — The command description.


A regex pattern match that will trigger the command

Returns string — The command patttern.


Handles the execution of the command.

Parameters

ParameterTypeDescription
$sharkordSharkordThe main bot instance.
$messageMessageThe message that triggered the command.
$argsstringThe arguments passed with the command.
$matchesarrayRegex capture groups from the command pattern.