GroupDmChannel
Represents a group DM channel.
Extends
BaseChannel
<ChannelType.GroupDM
,IsPartial
>
Type Parameters
Type Parameter | Default type |
---|---|
IsPartial extends boolean | false |
Constructors
new GroupDmChannel()
new GroupDmChannel<
IsPartial
>(client
,rawDataOrId
):GroupDmChannel
<IsPartial
>
Parameters
Parameter | Type |
---|---|
client | Client |
rawDataOrId | IsPartial extends true ? string : APIGroupDMChannel |
Returns
GroupDmChannel
<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 | APIGroupDMChannel | The raw data of the channel. | BaseChannel .rawData | - |
Accessors
applicationId
get
applicationId():IfPartial
<IsPartial
,null
|string
>
The ID of the application that created the channel, if it was created by a bot.
Returns
IfPartial
<IsPartial
, null
| string
>
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
icon
get
icon():IfPartial
<IsPartial
,null
|string
>
The icon hash of the channel.
Returns
IfPartial
<IsPartial
, null
| string
>
iconUrl
get
iconUrl():IfPartial
<IsPartial
,null
|string
>
Get the URL of the channel's icon.
Returns
IfPartial
<IsPartial
, null
| string
>
lastMessage
get
lastMessage():null
|Message
<true
>
The last message sent in the channel.
Remarks
This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted. This will always return a partial message, so you can use Message.fetch to get the full message data.
Returns
null
| Message
<true
>
lastMessageId
get
lastMessageId():IfPartial
<IsPartial
,null
|string
>
The ID of the last message sent in the channel.
Remarks
This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
Returns
IfPartial
<IsPartial
, null
| string
>
managed
get
managed():IfPartial
<IsPartial
,boolean
>
Whether the channel is managed by an Oauth2 application.
Returns
IfPartial
<IsPartial
, boolean
>
name
get
name():IfPartial
<IsPartial
,null
|string
>
The name of the channel.
Returns
IfPartial
<IsPartial
, null
| string
>
owner
get
owner():User
<true
>
Get the owner of the channel.
Returns
User
<true
>
ownerId
get
ownerId():IfPartial
<IsPartial
,null
|string
>
The ID of the user who created the channel.
Returns
IfPartial
<IsPartial
, null
| string
>
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
recipients
The recipients of the channel.
Returns
IfPartial
<IsPartial
, User
<boolean
>[]>
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
setData()
protected
setData(data
):void
Parameters
Parameter | Type |
---|---|
data | APIGroupDMChannel |
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" | "application_id" | "icon" | "owner_id" | "managed" |
value | unknown |
Returns
void
Inherited from
setName()
setName(
name
):Promise
<void
>
Set the name of the channel
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The new name of the channel |
Returns
Promise
<void
>