# BaseHandler

`class` in `core` · v0.1.0-next.5

<https://docs.seedcord.org/packages/core/0.1.0-next.5/classes/base-handler>

Base class every transport handler extends. Don't register handlers directly, use the more specific handler subclasses.

```ts
abstract class BaseHandler<Event, TCore extends CoreBase>
```

## Constructors

### constructor

```ts
protected BaseHandler(event: Event, core: TCore, dispatch?: DispatchContext)
```

Constructs a new instance of the `BaseHandler` class

## Properties

### core

```ts
public readonly core: TCore
```

### dispatch

```ts
protected readonly dispatch: DispatchContext | undefined
```

### event

```ts
protected readonly event: Event
```

### logger

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

## Methods

### execute

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

Holds the main logic of your handler. The dispatcher calls it after the handler's gates pass, so a gate that refuses stops `execute()` from running.
