Class

DMChannel

DM / Group DM / personal notes channel.

Extends TextCapable(Channel)

Constructor

new DMChannel(client: Client, data: APIChannelPartial | APIChannel)
client
Client

Properties

NameTypeDescription
lastMessageId?string | nullID of the last message sent in this channel.
nicksRecord<string, string>Custom nicknames for users in a group DM.
ownerIdstring | nullOwner ID for group DMs.
recipientsUser[]Recipients in this DM (includes the bot).

Methods

.addRecipient(userId)

userId: stringPromise<void>

Add a user to this group DM. Captcha-gated when captcha is enabled; bots are not exempt (CaptchaRequiredError).

await channel.addRecipient(userId);

.edit(options)

options: GroupDmEditOptionsPromise<this>

Edit this group DM (name, icon, nicks). Transferring ownership to a bot fails (CannotTransferOwnershipToBotError).

await channel.edit(options);

.pinInList()

Promise<void>

Pin this DM channel to the top of the DM list. Session-token helper; bots usually skip this.

await channel.pinInList();

.purgeMessages()

Promise<number>

Purge all messages from personal notes. Only works on personal notes channels. Notes-only; bots usually skip this.

await channel.purgeMessages();

.removeRecipient(userId, options?)

userId: string, options?: { silent?: boolean; }Promise<void>

Remove a user from this group DM.

await channel.removeRecipient(userId);

.unpinFromList()

Promise<void>

Unpin this DM channel from the DM list. Session-token helper; bots usually skip this.

await channel.unpinFromList();