BaseChannel
Extends
Base
Extended by
Type Parameters
Type Parameter | Default type |
---|---|
Type extends ChannelType | - |
IsPartial extends boolean | false |
Constructors
new BaseChannel()
new BaseChannel<
Type
,IsPartial
>(client
,rawDataOrId
):BaseChannel
<Type
,IsPartial
>
Parameters
Parameter | Type |
---|---|
client | Client |
rawDataOrId | IsPartial extends true ? string : Extract <APIDMChannel , object > | Extract <APIGroupDMChannel , object > | Extract <APIGuildCategoryChannel , object > | Extract <APIGuildForumChannel , object > | Extract <APIGuildMediaChannel , object > | Extract <APIGuildStageVoiceChannel , object > | Extract <APIGuildVoiceChannel , object > | Extract <APINewsChannel , object > | Extract <APITextChannel , object > | Extract <APIThreadChannel , object > |
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 , object > | Extract <APIGroupDMChannel , object > | Extract <APIGuildCategoryChannel , object > | Extract <APIGuildForumChannel , object > | Extract <APIGuildMediaChannel , object > | Extract <APIGuildStageVoiceChannel , object > | Extract <APIGuildVoiceChannel , object > | Extract <APINewsChannel , object > | Extract <APITextChannel , object > | Extract <APIThreadChannel , object > | null | The raw data of the channel. | - |
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
>
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
type
get
type():IfPartial
<IsPartial
,Type
>
The type of the channel.
Returns
IfPartial
<IsPartial
, Type
>
Methods
fetch()
fetch():
Promise
<void
>
Fetches the channel from the API.
Returns
Promise
<void
>
The channel data.
setData()
protected
setData(data
):void
Parameters
Parameter | Type |
---|---|
data | Extract <APIDMChannel , object > | Extract <APIGroupDMChannel , object > | Extract <APIGuildCategoryChannel , object > | Extract <APIGuildForumChannel , object > | Extract <APIGuildMediaChannel , object > | Extract <APIGuildStageVoiceChannel , object > | Extract <APIGuildVoiceChannel , object > | Extract <APINewsChannel , object > | Extract <APITextChannel , object > | Extract <APIThreadChannel , object > |
Returns
void
setField()
protected
setField(field
,value
):void
Parameters
Parameter | Type |
---|---|
field | keyof Extract <APIDMChannel , object > & keyof Extract <APIGroupDMChannel , object > & keyof Extract <APIGuildCategoryChannel , object > & keyof Extract <APIGuildForumChannel , object > & keyof Extract <APIGuildMediaChannel , object > & keyof Extract <APIGuildStageVoiceChannel , object > & keyof Extract <APIGuildVoiceChannel , object > & keyof Extract <APINewsChannel , object > & keyof Extract <APITextChannel , object > & keyof Extract <APIThreadChannel , object > |
value | unknown |
Returns
void