# WebhookLog

`class` in `core` · v0.10.0

<https://seedcord.org/docs/packages/core/0.10.0/classes/webhook-log>

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

Declare the url's environment variable with `@WebhookUrl` and implement [`report`](/docs/packages/core/0.10.0/classes/webhook-log#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.

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

## Constructors

### constructor

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

Instantiates the subscriber with event data and core.

## Properties

### core

```ts
protected readonly core: TCore
```

### data

```ts
protected readonly data: AllSubscriptions[KeyOfSubscribers]
```

### logger

```ts
protected readonly logger: Logger
```

## Methods

### execute

```ts
public async execute(): Promise<void>
```

### report

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

Builds the message for one published event.

### throttleKey

```ts
protected throttleKey(): string | null
```

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