# Subscribe

`function` in `seedcord` · v0.15.0

<https://docs.seedcord.org/packages/seedcord/0.15.0/functions/subscribe>

Registers a subscriber handler class with a specific subscriber event.

Associates the decorated class with a subscriber event type for automatic registration and execution when the subscriber is emitted.

```ts
Subscribe<TSubscriber>(
    subscriber: TSubscriber,
    options?: SubscribeOptions
): <HandlerCtor extends Constructor<Subscriber<TSubscriber>>>(
    constructor: HandlerCtor
) => void
```

Registers a subscriber handler class with a specific subscriber event.

Associates the decorated class with a subscriber event type for automatic registration and execution when the subscriber is emitted.

Parameters.

- `subscriber` `TSubscriber` — The subscriber event name to register for
- `options?` `SubscribeOptions` — Options to configure the subscriber handler registration.

Returns `<HandlerCtor extends Constructor<Subscriber<TSubscriber>>>(constructor: HandlerCtor) => void`.
