Carbon
CoreClasses

DmChannel

Represents a DM between two users.

Extends

Type Parameters

Type ParameterDefault type
IsPartial extends booleanfalse

Constructors

new DmChannel()

new DmChannel<IsPartial>(client, rawDataOrId): DmChannel<IsPartial>

Parameters

ParameterType
clientClient
rawDataOrIdIsPartial extends true ? string : APIDMChannel

Returns

DmChannel<IsPartial>

Inherited from

BaseChannel.constructor

Properties

PropertyModifierTypeDescriptionOverridesInherited from
clientpublicClient--BaseChannel.client
idreadonlystringThe id of the channel.-BaseChannel.id
rawDatapublicnull | APIDMChannelThe raw data of the channel.BaseChannel.rawData-

Accessors

flags

get flags(): IfPartial<IsPartial, undefined | ChannelFlags>

The flags of the channel in a bitfield.

See

https://discord.com/developers/docs/resources/channel#channel-object-channel-flags

Returns

IfPartial<IsPartial, undefined | ChannelFlags>

Inherited from

BaseChannel.flags


name

get name(): IfPartial<IsPartial, null>

The name of the channel. This is always null for DM channels.

Returns

IfPartial<IsPartial, null>


partial

get partial(): IsPartial

Whether the channel is a partial channel (meaning it does not have all the data). If this is true, you should use BaseChannel.fetch to get the full data of the channel.

Returns

IsPartial

Inherited from

BaseChannel.partial


type

get type(): IfPartial<IsPartial, Type>

The type of the channel.

Returns

IfPartial<IsPartial, Type>

Inherited from

BaseChannel.type

Methods

fetch()

fetch(): Promise<void>

Fetches the channel from the API.

Returns

Promise<void>

The channel data.

Inherited from

BaseChannel.fetch


send()

send(message): Promise<void>

Send a message to the channel

Parameters

ParameterType
messageMessagePayload

Returns

Promise<void>


setData()

protected setData(data): void

Parameters

ParameterType
dataAPIDMChannel

Returns

void

Inherited from

BaseChannel.setData


setField()

protected setField(field, value): void

Parameters

ParameterType
field"id" | "name" | "last_message_id" | "last_pin_timestamp" | "type" | "flags" | "recipients"
valueunknown

Returns

void

Inherited from

BaseChannel.setField

On this page

Edit on GitHub