Skip to content
Classcorev0.10.0

WebhookLog

Base class for subscribers that deliver their event to a Discord webhook.

Declare the url's environment variable with @WebhookUrl and implement report. The base resolves the url, validates it, reuses one sender per url, and sends. Registration skips a reporter whose variable is unset and warns at boot.

abstract class WebhookLog<
    KeyOfSubscribers extends SubscriptionKey,
    TCore extends CoreBase
> extends Subscriber<KeyOfSubscribers, TCore>

Member visibility

Filter class members by access level.

constructor

Instantiates the subscriber with event data and core.

Subscriber(data: AllSubscriptions[KeyOfSubscribers], core: TCore)
Parameter: data

The subscriber event data

Parameter: core

The core framework instance

Inherited from:Subscriber

Showing members with Protected visibility and higher.

KeyOfSubscribers

The subscription key this reporter receives

KeyOfSubscribers extends SubscriptionKey

TCore

The transport's Core

TCore extends CoreBase

core

protected readonly core: TCore

Inherited from:Subscriber

report()

Builds the message for one published event.

public abstract report(
    suppressed: number
): WebhookReport | Promise<WebhookReport>
Parameter: suppressed

How many events were dropped since the last card

throttleKey()

Events sharing this key collapse into one card per minute. Return null to send every event.

protected throttleKey(): string | null