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: string → Promise<void>

Add a user to this group DM.

await channel.addRecipient(userId);

.pinInList()

→ Promise<void>

Pin this DM channel to the top of the DM list.

await channel.pinInList();

.purgeMessages()

→ Promise<number>

Purge all messages from personal notes. Only works on personal notes channels.

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.

await channel.unpinFromList();