DmChannel
Represents a DM between two users.
Extends
BaseChannel
<ChannelType.DM
,IsPartial
>
Type Parameters
Type Parameter | Default type |
---|---|
IsPartial extends boolean | false |
Constructors
new DmChannel()
new DmChannel<
IsPartial
>(client
,rawDataOrId
):DmChannel
<IsPartial
>
Parameters
Parameter | Type |
---|---|
client | Client |
rawDataOrId | IsPartial extends true ? string : APIDMChannel |
Returns
DmChannel
<IsPartial
>
Inherited from
Properties
Property | Modifier | Type | Description | Overrides | Inherited from |
---|---|---|---|---|---|
client | public | Client | - | - | BaseChannel .client |
id | readonly | string | The id of the channel. | - | BaseChannel .id |
rawData | public | null | APIDMChannel | The 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
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
type
get
type():IfPartial
<IsPartial
,Type
>
The type of the channel.
Returns
IfPartial
<IsPartial
, Type
>
Inherited from
Methods
fetch()
fetch():
Promise
<void
>
Fetches the channel from the API.
Returns
Promise
<void
>
The channel data.
Inherited from
send()
send(
message
):Promise
<void
>
Send a message to the channel
Parameters
Parameter | Type |
---|---|
message | MessagePayload |
Returns
Promise
<void
>
setData()
protected
setData(data
):void
Parameters
Parameter | Type |
---|---|
data | APIDMChannel |
Returns
void
Inherited from
setField()
protected
setField(field
,value
):void
Parameters
Parameter | Type |
---|---|
field | "id" | "name" | "last_message_id" | "last_pin_timestamp" | "type" | "flags" | "recipients" |
value | unknown |
Returns
void