Alerts

You can easily send manual custom alerts using our alerts utils from the package core.

Logger and StatsPublisher can automatically send alerts if the Core Package is configured to return a Webhook url from getWebhookUrl

Yet, the alert system can only handle Discord Webhooks

Using the alert tool, you can generate embed:

Alert Log Info
Alert Log Endpoint
Alert Log Stats Performance

Generate & send Alert

const logEmbed = generateDiscordAlertLogMessageContent(...);
const endpointEmbed = generateDiscordApiLogMessageContent(...);
const statsEmbed = generateDiscordStatsMessageContent(...);

// You can publish it manually to Discord Webhooks
await axios.post('...', logEmbed);


// Or you can use the Alert Utils to generate the embed and post it
await sendLogAlert({
   ...
});
await sendLogAlert({
   ...
});
await sendStatsAlert({
    ...
});

By using the Alert Utils, it will automatically handle rate limits from Discord API

Last updated