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
KeyOfSubscribers
The subscription key or keys that this reporter receives, the same ones as @Subscribe
KeyOfSubscribers extends SubscriptionKeycore
protected readonly core: TCoreInherited 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: KeysInherited from:Subscriber
logger
protected readonly logger: LoggerInherited from:Subscriber
execute()
Inherited from:WebhookLog
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>>RetThe 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
report()
Builds the message for one published event.
abstract report(
suppressed: number
): WebhookReport | Promise<WebhookReport>suppressedHow many events were dropped since the last card
Inherited from:WebhookLog
throttleKey()
Events sharing this key collapse into one card per minute. Return null to send every event.
Inherited from:WebhookLog