# EventMiddlewareOptions

`interface` in `gateway` · v0.6.0

<https://docs.seedcord.org/packages/gateway/0.6.0/interfaces/event-middleware-options>

Registration options for an event middleware.

```ts
interface EventMiddlewareOptions<
    Events extends NonEmptyTuple<ValidNonInteractionKeys>
>
```

## Properties

### events

```ts
readonly events: Events
```

Restrict this middleware to certain Discord client events. The middleware's `EventMiddleware` generic must list the same events, or applying the decorator is a compile error. Omit it to run on every event.

### priority

```ts
readonly priority: number
```

Lower runs earlier. Two middleware sharing a priority run in registration order.
