Carbon
Core/Classes

BaseChannel

Extends

  • Base

Extended by

Type Parameters

Type ParameterDefault type
Type extends ChannelType-
IsPartial extends booleanfalse

Constructors

Constructor

new BaseChannel<Type, IsPartial>(client, rawDataOrId): BaseChannel<Type, IsPartial>

Parameters

ParameterType
clientClient
rawDataOrIdIsPartial 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

PropertyModifierTypeDefault valueDescriptionInherited from
clientpublicClientundefined-Base.client
idreadonlystringundefinedThe id of the channel.-
rawDataprotectednull | 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; }>nullThe 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

ParameterType
dataExtract<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

ParameterType
fieldkeyof 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; }>
valueunknown

Returns

void

On this page