# WebhookLog

`class` in `gateway` · v0.1.0-next.3

<https://docs.seedcord.org/packages/gateway/0.1.0-next.3/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`](/packages/gateway/0.1.0-next.3/classes/webhook-log#report). Url resolution, validation, sender reuse, and sending run in the base. When the variable is unset the reporter is skipped at registration with a boot warning.

```ts
abstract class WebhookLog<
    KeyOfSubscribers extends SubscriptionKey
> extends Subscriber<KeyOfSubscribers>
```

## Constructors

### constructor

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

Instantiates the subscriber with event data and core.

## Properties

### core

```ts
protected readonly core: Core
```

### 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(): WebhookReport | Promise<WebhookReport>
```

Builds the message for one published event.
