Skip to content

Sharkord

Class  ·  Sharkord\Sharkord

Class Sharkord

The core orchestrator for the SharkordPHP framework. Manages the event loop, network layers, and data managers.

PropertyTypeDescription
$http (read-only)Client
$gateway (read-only)Gateway
$guard (read-only)Guard
$loop (read-only)LoopInterface
$channelsChannelManager
$usersUserManager
$categoriesCategoryManager
$rolesRoleManager
$serversServerManager
$messagesMessageManager
$invitesInviteManager
$dmsDmManager
$commandsCommandRouter
$loggerLoggerInterface
$bot?User

Sharkord constructor.

Parameters

ParameterTypeDescription
$configarrayConfiguration array containing ‘host’, ‘identity’, and ‘password’.
$loop (optional)?LoopInterfaceThe ReactPHP event loop instance.
$logger (optional)?LoggerInterfaceA PSR-3 logger. A Monolog instance is created if omitted.
$logLevel (optional)stringMinimum log level when instantiating the default logger.
$reconnect (optional)boolWhether to attempt reconnection on disconnect.
$maxReconnectAttempts (optional)intMaximum number of reconnect attempts before exiting.

Authenticates and starts the bot, then runs the event loop.


Gracefully shuts down the framework.