DmChannel
Represents a DM between two users.
Extends
BaseChannel
<ChannelType.DM
,IsPartial
>
Type Parameters
Type Parameter | Default type |
---|---|
IsPartial extends boolean | false |
Constructors
Constructor
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 Signature
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 Signature
get name():
IfPartial
<IsPartial
,null
>
The name of the channel. This is always null for DM channels.
Returns
IfPartial
<IsPartial
, null
>
partial
Get Signature
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 Signature
get type():
IfPartial
<IsPartial
,Type
>
The type of the channel.
Returns
IfPartial
<IsPartial
, Type
>
Inherited from
Methods
delete()
delete():
Promise
<void
>
Delete the channel
Returns
Promise
<void
>
Inherited from
fetch()
fetch():
Promise
<BaseChannel
<DM
,false
>>
Fetches the channel from the API.
Returns
Promise
<BaseChannel
<DM
, false
>>
A Promise that resolves to a non-partial channel
Inherited from
send()
Send a message to the channel
Parameters
Parameter | Type |
---|---|
message | MessagePayload |
Returns
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" | "type" | "name" | "last_message_id" | "last_pin_timestamp" | "flags" | "recipients" |
value | unknown |
Returns
void
Inherited from
toString()
toString():
string
Returns the Discord mention format for this channel
Returns
string
The mention string in the format <#channelId>