Skip to content
Classhttpv0.12.0

WebhookLog

Base class for an HTTP subscriber that delivers its event to a Discord webhook, binding this.core to the HTTP Core.

abstract class WebhookLog<
    KeyOfSubscribers extends SubscriptionKey
> extends WebhookLog<KeyOfSubscribers, Core>

Member visibility

Filter class members by access level.

constructor

Constructs a new instance of the Subscriber class

Subscriber(payload: AllSubscriptions[Keys], core: TCore, key: Keys)

Inherited from:Subscriber

Showing members with Protected visibility and higher.

KeyOfSubscribers

The subscription key or keys that this reporter receives, the same ones as @Subscribe

KeyOfSubscribers extends SubscriptionKey

core

protected readonly core: TCore

Inherited from:Subscriber

data

The published payload. It's never on a subscriber for several keys, where this.match reads it.

protected data: SingleKeyData<Keys>

Inherited from:Subscriber

key

protected readonly key: Keys

Inherited from:Subscriber

match()

Run the case for the published key. Use this only when the subscriber is registered for several keys. On a single-key subscriber, read this.data directly.

Provide one case per registered key. Each case receives that key's own payload. A missing key or an unknown key is a compile error.

protected async match<Ret, Cases>(
    cases: OnlyCases<Cases, SubscriberMatchCases<Keys, Ret>>
): Promise<MatchResult<Ret, Cases>>
Type parameter: Ret

The type that every case must return. Leave it out to get the union of what the cases return.

Throws:

A SeedcordTypeError with MatchCaseMissing when the published key doesn't have a case.

Inherited from:Subscriber

throttleKey()

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

protected throttleKey(): string | null

Inherited from:WebhookLog