BaseChannel
Extends
Base
Extended by
Type Parameters
Type Parameter | Default type |
---|---|
Type extends ChannelType | - |
IsPartial extends boolean | false |
Constructors
Constructor
new BaseChannel<
Type
,IsPartial
>(client
,rawDataOrId
):BaseChannel
<Type
,IsPartial
>
Parameters
Parameter | Type |
---|---|
client | Client |
rawDataOrId | IsPartial extends true ? string : Extract <APIDMChannel , { type : Type ; }> | Extract <APIGroupDMChannel , { type : Type ; }> | Extract <APIGuildCategoryChannel , { type : Type ; }> | Extract <APIGuildForumChannel , { type : Type ; }> | Extract <APIGuildMediaChannel , { type : Type ; }> | Extract <APIGuildStageVoiceChannel , { type : Type ; }> | Extract <APIGuildVoiceChannel , { type : Type ; }> | Extract <APINewsChannel , { type : Type ; }> | Extract <APITextChannel , { type : Type ; }> | Extract <APIThreadChannel , { type : Type ; }> |
Returns
BaseChannel
<Type
, IsPartial
>
Overrides
Base.constructor
Properties
Property | Modifier | Type | Default value | Description | Inherited from |
---|---|---|---|---|---|
client | public | Client | undefined | - | Base.client |
id | readonly | string | undefined | The id of the channel. | - |
rawData | protected | null | Extract <APIDMChannel , { type : Type ; }> | Extract <APIGroupDMChannel , { type : Type ; }> | Extract <APIGuildCategoryChannel , { type : Type ; }> | Extract <APIGuildForumChannel , { type : Type ; }> | Extract <APIGuildMediaChannel , { type : Type ; }> | Extract <APIGuildStageVoiceChannel , { type : Type ; }> | Extract <APIGuildVoiceChannel , { type : Type ; }> | Extract <APINewsChannel , { type : Type ; }> | Extract <APITextChannel , { type : Type ; }> | Extract <APIThreadChannel , { type : Type ; }> | null | The raw data of the channel. | - |
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
>
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
type
Get Signature
get type():
IfPartial
<IsPartial
,Type
>
The type of the channel.
Returns
IfPartial
<IsPartial
, Type
>
Methods
fetch()
fetch():
Promise
<BaseChannel
<Type
,false
>>
Fetches the channel from the API.
Returns
Promise
<BaseChannel
<Type
, false
>>
A Promise that resolves to a non-partial channel
setData()
protected
setData(data
):void
Parameters
Parameter | Type |
---|---|
data | Extract <APIDMChannel , { type : Type ; }> | Extract <APIGroupDMChannel , { type : Type ; }> | Extract <APIGuildCategoryChannel , { type : Type ; }> | Extract <APIGuildForumChannel , { type : Type ; }> | Extract <APIGuildMediaChannel , { type : Type ; }> | Extract <APIGuildStageVoiceChannel , { type : Type ; }> | Extract <APIGuildVoiceChannel , { type : Type ; }> | Extract <APINewsChannel , { type : Type ; }> | Extract <APITextChannel , { type : Type ; }> | Extract <APIThreadChannel , { type : Type ; }> |
Returns
void
setField()
protected
setField(field
,value
):void
Parameters
Parameter | Type |
---|---|
field | keyof Extract <APIDMChannel , { type : Type ; }> & keyof Extract <APIGroupDMChannel , { type : Type ; }> & keyof Extract <APIGuildCategoryChannel , { type : Type ; }> & keyof Extract <APIGuildForumChannel , { type : Type ; }> & keyof Extract <APIGuildMediaChannel , { type : Type ; }> & keyof Extract <APIGuildStageVoiceChannel , { type : Type ; }> & keyof Extract <APIGuildVoiceChannel , { type : Type ; }> & keyof Extract <APINewsChannel , { type : Type ; }> & keyof Extract <APITextChannel , { type : Type ; }> & keyof Extract <APIThreadChannel , { type : Type ; }> |
value | unknown |
Returns
void