action field that determines how the client processes it.
Message structure
All messages sent from the server are JSON objects with at least anaction field:
Available actions
enabled
Notifies you that Sol’s Stat Tracker has been enabled. Payload structure:This action indicates that stat tracking is now active and you will begin receiving webhook executions.
disabled
Notifies you that Sol’s Stat Tracker has been disabled. Payload structure:This action indicates that stat tracking has been turned off and you will no longer receive webhook executions until it’s re-enabled.
executeWebhook
Instructs you to execute a Discord webhook with the provided data payload. Payload structure:Contains the Discord webhook execution payload. This includes all standard Discord webhook fields.
The username to display for the webhook message. Can be overridden by
overrideUsername in your configuration.The avatar URL to display for the webhook message. Can be overridden by
overrideAvatarURL in your configuration.Array of Discord embed objects to send with the webhook.
Text content of the webhook message.
-
Applies configuration overrides:
- Replaces
usernamewithoverrideUsernameif configured - Replaces
avatarURLwithoverrideAvatarURLif configured
- Replaces
-
Enforces security by setting
allowedMentionsto prevent all mentions - Executes the Discord webhook with the processed payload
Invalid actions
If you receive a message with an unrecognized action, the client logs an error:Connection lifecycle events
In addition to server actions, the client handles connection lifecycle events:Connection established
When the WebSocket connection is successfully established, the client waits 1 second and sends a “Connected” embed to your webhook (ifverboseLogging is enabled).
Reconnection
When the connection closes with certain error codes, the client automatically attempts to reconnect with exponential backoff:- Initial interval: 31 seconds
- Backoff strategy: Interval doubles after each failed attempt
- Maximum interval: Defined by
maxReconnectIntervalconfiguration