Carbon
CoreClasses

BaseGuildChannel

Extends

Extended by

Type Parameters

Type ParameterDefault type
Type extends GuildChannelType-
IsPartial extends booleanfalse

Constructors

new BaseGuildChannel()

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

Parameters

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

BaseGuildChannel<Type, IsPartial>

Inherited from

BaseChannel.constructor

Properties

PropertyModifierTypeDescriptionOverridesInherited from
clientpublicClient--BaseChannel.client
idreadonlystringThe id of the channel.-BaseChannel.id
rawDatapublicnull | APIGuildChannel<Type>The raw data of the channel.BaseChannel.rawData-

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>

Inherited from

BaseChannel.flags


guild

get guild(): IfPartial<IsPartial, Guild<true>>

The guild this channel is in

Returns

IfPartial<IsPartial, Guild<true>>


guildId

get guildId(): IfPartial<IsPartial, string>

The ID of the guild this channel is in

Returns

IfPartial<IsPartial, string>


name

get name(): IfPartial<IsPartial, string>

The name of the channel.

Returns

IfPartial<IsPartial, string>


nsfw

get nsfw(): IfPartial<IsPartial, boolean>

Whether the channel is marked as nsfw.

Returns

IfPartial<IsPartial, boolean>


parentId

get parentId(): IfPartial<IsPartial, null | string>

The ID of the parent category for 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

BaseChannel.partial


position

get position(): IfPartial<IsPartial, number>

The position of the channel in the channel list.

Returns

IfPartial<IsPartial, number>


type

get type(): IfPartial<IsPartial, Type>

The type of the channel.

Returns

IfPartial<IsPartial, Type>

Inherited from

BaseChannel.type

Methods

createInvite()

createInvite(options?): Promise<APIExtendedInvite>

Create an invite for the channel

Parameters

ParameterType
options?RESTPostAPIChannelInviteJSONBody

Returns

Promise<APIExtendedInvite>


fetch()

fetch(): Promise<void>

Fetches the channel from the API.

Returns

Promise<void>

The channel data.

Inherited from

BaseChannel.fetch


getInvites()

getInvites(): Promise<RESTGetAPIGuildInvitesResult>

Get the invites for the channel

Returns

Promise<RESTGetAPIGuildInvitesResult>


send()

send(message): Promise<void>

Send a message to the channel

Parameters

ParameterType
messageMessagePayload

Returns

Promise<void>


setData()

protected setData(data): void

Parameters

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

Inherited from

BaseChannel.setData


setField()

protected setField(field, value): void

Parameters

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

Returns

void

Inherited from

BaseChannel.setField


setName()

setName(name): Promise<void>

Set the name of the channel

Parameters

ParameterTypeDescription
namestringThe new name of the channel

Returns

Promise<void>


setNsfw()

setNsfw(nsfw): Promise<void>

Set whether the channel is nsfw

Parameters

ParameterTypeDescription
nsfwbooleanThe new nsfw status of the channel

Returns

Promise<void>


setParent()

setParent(parent): Promise<void>

Set the parent ID of the channel

Parameters

ParameterTypeDescription
parentstring | GuildCategoryChannel<false>The new category channel or ID to set

Returns

Promise<void>


setPosition()

setPosition(position): Promise<void>

Set the position of the channel

Parameters

ParameterTypeDescription
positionnumberThe new position of the channel

Returns

Promise<void>


triggerTyping()

triggerTyping(): Promise<void>

Trigger a typing indicator in the channel (this will expire after 10 seconds)

Returns

Promise<void>

On this page

Edit on GitHub