Carbon
CoreClasses

GuildThreadChannel

Extends

Type Parameters

Type ParameterDefault type
Type extends ThreadChannelType-
IsPartial extends booleanfalse

Constructors

new GuildThreadChannel()

new GuildThreadChannel<Type, IsPartial>(client, rawDataOrId): GuildThreadChannel<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

GuildThreadChannel<Type, IsPartial>

Inherited from

BaseGuildChannel.constructor

Properties

PropertyModifierTypeDescriptionOverridesInherited from
clientpublicClient--BaseGuildChannel.client
idreadonlystringThe id of the channel.-BaseGuildChannel.id
rawDatapublicnull | APIThreadChannelThe raw data of the channel.BaseGuildChannel.rawData-

Accessors

appliedTags

get appliedTags(): IfPartial<IsPartial, string[]>

The tags applied to the thread.

Returns

IfPartial<IsPartial, string[]>


archived

get archived(): IfPartial<IsPartial, undefined | boolean>

Whether the thread is archived.

Returns

IfPartial<IsPartial, undefined | boolean>


archiveTimestamp

get archiveTimestamp(): IfPartial<IsPartial, undefined | string>

The timestamp of when the thread was archived.

Returns

IfPartial<IsPartial, undefined | string>


autoArchiveDuration

get autoArchiveDuration(): IfPartial<IsPartial, undefined | number>

The duration until the thread is auto archived.

Returns

IfPartial<IsPartial, undefined | number>


createTimestamp

get createTimestamp(): IfPartial<IsPartial, undefined | string>

The timestamp of when the thread was created.

Returns

IfPartial<IsPartial, undefined | 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

BaseGuildChannel.flags


guild

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

The guild this channel is in

Returns

IfPartial<IsPartial, Guild<true>>

Inherited from

BaseGuildChannel.guild


guildId

get guildId(): IfPartial<IsPartial, string>

The ID of the guild this channel is in

Returns

IfPartial<IsPartial, string>

Inherited from

BaseGuildChannel.guildId


invitable

get invitable(): IfPartial<IsPartial, undefined | boolean>

Whether non-moderators can add other non-moderators to a thread; only available on private threads

Returns

IfPartial<IsPartial, undefined | boolean>


locked

get locked(): IfPartial<IsPartial, undefined | boolean>

Whether the thread is locked.

Returns

IfPartial<IsPartial, undefined | boolean>


memberCount

get memberCount(): IfPartial<IsPartial, undefined | number>

The number of members in the thread.

Remarks

This is only accurate until 50, after that, Discord stops counting.

Returns

IfPartial<IsPartial, undefined | number>


messageCount

get messageCount(): IfPartial<IsPartial, undefined | number>

The number of messages in the thread.

Returns

IfPartial<IsPartial, undefined | number>


name

get name(): IfPartial<IsPartial, string>

The name of the channel.

Returns

IfPartial<IsPartial, string>

Inherited from

BaseGuildChannel.name


nsfw

get nsfw(): IfPartial<IsPartial, boolean>

Whether the channel is marked as nsfw.

Returns

IfPartial<IsPartial, boolean>

Inherited from

BaseGuildChannel.nsfw


ownerId

get ownerId(): IfPartial<IsPartial, undefined | string>

The ID of the owner of the thread.

Returns

IfPartial<IsPartial, undefined | string>


parentId

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

The ID of the parent category for the channel.

Returns

IfPartial<IsPartial, null | string>

Inherited from

BaseGuildChannel.parentId


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

BaseGuildChannel.partial


position

get position(): IfPartial<IsPartial, number>

The position of the channel in the channel list.

Returns

IfPartial<IsPartial, number>

Inherited from

BaseGuildChannel.position


totalMessageSent

get totalMessageSent(): IfPartial<IsPartial, undefined | number>

The number of messages sent in the thread.

Returns

IfPartial<IsPartial, undefined | number>


type

get type(): IfPartial<IsPartial, Type>

The type of the channel.

Returns

IfPartial<IsPartial, Type>

Inherited from

BaseGuildChannel.type

Methods

addMember()

addMember(userId): Promise<void>

Add a member to the thread

Parameters

ParameterType
userIdstring

Returns

Promise<void>


archive()

archive(): Promise<void>

Archive the thread

Returns

Promise<void>


createInvite()

createInvite(options?): Promise<APIExtendedInvite>

Create an invite for the channel

Parameters

ParameterType
options?RESTPostAPIChannelInviteJSONBody

Returns

Promise<APIExtendedInvite>

Inherited from

BaseGuildChannel.createInvite


fetch()

fetch(): Promise<void>

Fetches the channel from the API.

Returns

Promise<void>

The channel data.

Inherited from

BaseGuildChannel.fetch


getInvites()

getInvites(): Promise<RESTGetAPIGuildInvitesResult>

Get the invites for the channel

Returns

Promise<RESTGetAPIGuildInvitesResult>

Inherited from

BaseGuildChannel.getInvites


join()

join(): Promise<void>

Join the thread

Returns

Promise<void>


leave()

leave(): Promise<void>

Leave the thread

Returns

Promise<void>


lock()

lock(): Promise<void>

Lock the thread

Returns

Promise<void>


removeMember()

removeMember(userId): Promise<void>

Get the pinned messages in the thread

Parameters

ParameterType
userIdstring

Returns

Promise<void>


send()

send(message): Promise<void>

Send a message to the channel

Parameters

ParameterType
messageMessagePayload

Returns

Promise<void>

Inherited from

BaseGuildChannel.send


setAutoArchiveDuration()

setAutoArchiveDuration(duration): Promise<void>

Set the auto archive duration of the thread

Parameters

ParameterType
durationnumber

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

BaseGuildChannel.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

BaseGuildChannel.setField


setName()

setName(name): Promise<void>

Set the name of the channel

Parameters

ParameterTypeDescription
namestringThe new name of the channel

Returns

Promise<void>

Inherited from

BaseGuildChannel.setName


setNsfw()

setNsfw(nsfw): Promise<void>

Set whether the channel is nsfw

Parameters

ParameterTypeDescription
nsfwbooleanThe new nsfw status of the channel

Returns

Promise<void>

Inherited from

BaseGuildChannel.setNsfw


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>

Inherited from

BaseGuildChannel.setParent


setPosition()

setPosition(position): Promise<void>

Set the position of the channel

Parameters

ParameterTypeDescription
positionnumberThe new position of the channel

Returns

Promise<void>

Inherited from

BaseGuildChannel.setPosition


triggerTyping()

triggerTyping(): Promise<void>

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

Returns

Promise<void>

Inherited from

BaseGuildChannel.triggerTyping


unarchive()

unarchive(): Promise<void>

Unarchive the thread

Returns

Promise<void>


unlock()

unlock(): Promise<void>

Unlock the thread

Returns

Promise<void>

On this page

Edit on GitHub