> For the complete documentation index, see [llms.txt](https://ghom.gitbook.io/bot.ts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ghom.gitbook.io/bot.ts/utilities/special-events.md).

# Special events

## `messageEmitter`

An instance of `EventEmitter` specifically designed to handle message events.

***

## `onceMessage` Function

The `onceMessage` function allows you to register a callback for a specific event that will only be executed once. After it is triggered, it will be removed automatically.

### Parameters:

* **`emitter`**: The specific event emitter (from `EventEmitters`).
* **`cb`**: The callback function to execute when the event is emitted.

### Example:

```ts
onceMessage("messageCreate", (message) => {
  console.log(`Message received: ${message.content}`)
})
```

***

## More default Client events

The `MoreClientEvents` interface extends the default Discord client events by adding custom events, such as `raw` and `afterReady`.

### Example:

```ts
export interface MoreClientEvents {
  raw: [packet: apiTypes.GatewayDispatchPayload]
  afterReady: [discord.Client<true>] // Wait for all "ready" asyncronous listeners before triggering
}
```

***
