CommandInterface
Interface · Sharkord\Commands\CommandInterface
Interface CommandInterface
Defines the contract that all bot commands must follow.
Methods
Section titled “Methods”getName()
Section titled “getName()”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.
getDescription()
Section titled “getDescription()”Retrieves a brief description of what the command does.
Returns string — The command description.
getPattern()
Section titled “getPattern()”A regex pattern match that will trigger the command
Returns string — The command patttern.
handle()
Section titled “handle()”Handles the execution of the command.
Parameters
| Parameter | Type | Description |
|---|---|---|
$sharkord | Sharkord | The main bot instance. |
$message | Message | The message that triggered the command. |
$args | string | The arguments passed with the command. |
$matches | array | Regex capture groups from the command pattern. |