.addRecipient(userId)
userId: string → Promise<void>
Add a user to this group DM. Captcha-gated when captcha is enabled; bots are not exempt (CaptchaRequiredError).
await channel.addRecipient(userId);Class
DM / Group DM / personal notes channel.
Extends TextCapable(Channel)
new DMChannel(client: Client, data: APIChannelPartial | APIChannel)ClientAPIChannelPartial | APIChannel| Name | Type | Description |
|---|---|---|
| lastMessageId? | string | null | ID of the last message sent in this channel. |
| nicks | Record<string, string> | Custom nicknames for users in a group DM. |
| ownerId | string | null | Owner ID for group DMs. |
| recipients | User[] | Recipients in this DM (includes the bot). |
userId: string → Promise<void>
Add a user to this group DM. Captcha-gated when captcha is enabled; bots are not exempt (CaptchaRequiredError).
await channel.addRecipient(userId);options: GroupDmEditOptions → Promise<this>
Edit this group DM (name, icon, nicks). Transferring ownership to a bot fails (CannotTransferOwnershipToBotError).
await channel.edit(options);→ Promise<void>
Pin this DM channel to the top of the DM list. Session-token helper; bots usually skip this.
await channel.pinInList();→ Promise<number>
Purge all messages from personal notes. Only works on personal notes channels. Notes-only; bots usually skip this.
await channel.purgeMessages();userId: string, options?: { silent?: boolean; } → Promise<void>
Remove a user from this group DM.
await channel.removeRecipient(userId);→ Promise<void>
Unpin this DM channel from the DM list. Session-token helper; bots usually skip this.
await channel.unpinFromList();