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.
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 SubscriptionKeyTCore
The transport's Core
TCore extends CoreBaseprotected readonly core: TCoreInherited from:Subscriber
protected data: SingleKeyData<Keys>Inherited from:Subscriber
protected readonly key: KeysInherited from:Subscriber
protected readonly logger: LoggerInherited from:Subscriber
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
public abstract report(
suppressed: number
): WebhookReport | Promise<WebhookReport>suppressedHow many events were dropped since the last card