Sharkord
Class · Sharkord\Sharkord
Class Sharkord
The core orchestrator for the SharkordPHP framework. Manages the event loop, network layers, and data managers.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$http (read-only) | Client | |
$gateway (read-only) | Gateway | |
$guard (read-only) | Guard | |
$loop (read-only) | LoopInterface | |
$channels | ChannelManager | |
$users | UserManager | |
$categories | CategoryManager | |
$roles | RoleManager | |
$servers | ServerManager | |
$messages | MessageManager | |
$invites | InviteManager | |
$dms | DmManager | |
$commands | CommandRouter | |
$logger | LoggerInterface | |
$bot | ?User |
Methods
Section titled “Methods”__construct()
Section titled “__construct()”Sharkord constructor.
Parameters
| Parameter | Type | Description |
|---|---|---|
$config | array | Configuration array containing ‘host’, ‘identity’, and ‘password’. |
$loop (optional) | ?LoopInterface | The ReactPHP event loop instance. |
$logger (optional) | ?LoggerInterface | A PSR-3 logger. A Monolog instance is created if omitted. |
$logLevel (optional) | string | Minimum log level when instantiating the default logger. |
$reconnect (optional) | bool | Whether to attempt reconnection on disconnect. |
$maxReconnectAttempts (optional) | int | Maximum number of reconnect attempts before exiting. |
Authenticates and starts the bot, then runs the event loop.
stop()
Section titled “stop()”Gracefully shuts down the framework.