> ## Documentation Index
> Fetch the complete documentation index at: https://www.chapterjs.org/llms.txt
> Use this file to discover all available pages before exploring further.

# DMChannel

> A private conversation between the bot and a user

A `DMChannel` is a private conversation between the bot and a user. It is what `channel.isDM()` gives, the `channel` of a [private message](https://www.chapterjs.org/reference/message.md#dmmessage) and of a command used in a private message, and what `user.createDM()` returns. To write to someone, `user.send()` is shorter.

```ts theme={"theme":{"light":"github-light","dark":"vesper"}}
import type { DMChannel } from 'chapterjs';

async function thank(channel: DMChannel) {
  const name = channel.recipient?.displayName ?? 'there';
  await channel.send(`Thanks for your message, ${name}! A moderator will answer soon.`);
}
```

> [!NOTE]
>
> How to send, edit and read messages is in [Sending messages](https://www.chapterjs.org/messages.md). Private messages only reach your bot with `chapterjs start`: see [Private messages](https://www.chapterjs.org/events/messages.md).

## Properties

It also has everything of [Channel](https://www.chapterjs.org/reference/channels#channel) and [what channels with messages share](https://www.chapterjs.org/reference/channels#channels-with-messages). `guildId` and `guild` are `null`: there is no server.

**recipientId** `Snowflake | null`

The id of the user the bot talks to.

**recipient** `User | null`

The user the bot talks to, when it is known.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.