abstract class FossabotCommand implements FossabotCommand (View source)

Class to define a response for a Fossabot custom API request. This class is only tasked with returning the response string back to Fossabot, and can use any of the additional context information to make its response.

Methods

string
__invoke(FossabotContext|null $context = null)

Get string response for a Fossabot custom API request.

Details

string __invoke(FossabotContext|null $context = null)

Get string response for a Fossabot custom API request.

NOTE: The $context will only be provided if the \Brandon14\FossabotCommander\Contracts\FossabotCommander::runCommand() is invoked with the $getContext method as true, which is default.

Parameters

FossabotContext|null $context

Request context

Return Value

string

Custom API response

Exceptions

Throwable