ThreadChannel

export class ThreadChannel<ThreadOnly extends boolean = boolean> extends TextBasedChannelMixin(BaseChannel, true, [
'fetchWebhooks',
'createWebhook',
'setNSFW',
])
export class ThreadChannel<ThreadOnly extends boolean = boolean> extends TextBasedChannelMixin(BaseChannel, true, [
'fetchWebhooks',
'createWebhook',
'setNSFW',
])
Represents a thread channel on Discord.

Extends

TextBasedChannelMixin(BaseChannel, true, [ 'fetchWebhooks', 'createWebhook', 'setNSFW', ])
NameConstraintsOptionalDefaultDescription
ThreadOnlybooleanYesbooleanNone
appliedTags:Snowflake[]
The tags applied to this thread
archived:boolean | null
Whether the thread is archived
Readonly
archivedAt:Date | null
The time at which this thread's archive status was last changed If the thread was never archived or unarchived, this is the time at which the thread was created
archiveTimestamp:number | null
The timestamp when the thread's archive status was last changed If the thread was never archived or unarchived, this is the timestamp at which the thread was created
autoArchiveDuration:ThreadAutoArchiveDuration | null
The amount of time (in minutes) after which the thread will automatically archive in case of no recent activity
Readonly
createdAt:Date | null
The time the thread was created at
Readonly
createdTimestamp:number | null
The timestamp when this thread was created. This isn't available for threads created before 2022-01-09
Readonly
editable:boolean
Whether the thread is editable by the client user (name, archived, autoArchiveDuration)
flags:Readonly<ChannelFlagsBitField>
The flags that are applied to the channel. This is only null in a PartialGroupDMChannel. In all other cases, it is not null.
guild:Guild
The guild the thread is in
guildId:Snowflake
The id of the guild the channel is in
Readonly
A collection of associated guild member objects of this thread's members
invitable:boolean | null
Whether members without the permission can invite other members to this thread. This property is always null in public threads.
Readonly
joinable:boolean
Whether the thread is joinable by the client user
Readonly
joined:boolean
Whether the client user is a member of the thread.
locked:boolean | null
Whether the thread is locked
Readonly
manageable:boolean
Whether the thread is manageable by the client user, for deleting or editing rateLimitPerUser or locked.
memberCount:number | null
The approximate count of users in this thread This stops counting at 50. If you need an approximate value higher than that, use ThreadChannel#members.cache.size
A manager of the members that are part of this thread
messageCount:number | null
The approximate count of messages in this thread Threads created before July 1, 2022 may have an inaccurate count. If you need an approximate value higher than that, use ThreadChannel#messages.cache.size
name:string
The name of the thread
ownerId:Snowflake | null
The id of the member who created this thread
Readonly
parent:If<ThreadOnly, ForumChannel | MediaChannel, TextChannel | NewsChannel> | null
The parent channel of this thread
parentId:Snowflake | null
The id of the parent channel of this thread
rateLimitPerUser:number | null
The rate limit per user (slowmode) for this thread in seconds
Readonly
sendable:boolean
Whether the client user can send messages in this thread
totalMessageSent:number | null
The number of messages ever sent in a thread, similar to messageCount except it will not decrement whenever a message is deleted
The type of the channel
Readonly
unarchivable:boolean
Whether the thread is unarchivable by the client user
Readonly
viewable:boolean
Whether the thread is viewable by the client user
delete(reason?):Promise<this>
Deletes this thread.
NameTypeOptionalDescription
reasonstringYesReason for deleting this thread
edit(options):Promise<AnyThreadChannel>
Edits this thread.
NameTypeOptionalDescription
optionsThreadEditOptionsNoThe options to provide
fetchOwner(options?):Promise<ThreadMember | null>
Fetches the owner of this thread. If the thread member object isn't needed, use ownerId instead.
NameTypeOptionalDescription
optionsBaseFetchOptionsYesThe options for fetching the member
fetchStarterMessage(options?):Promise<Message<true> | null>
Fetches the message that started this thread, if any. The Promise will reject if the original message in a forum post is deleted or when the original message in the parent channel is deleted. If you just need the id of that message, use instead.
NameTypeOptionalDescription
optionsBaseFetchOptionsYesAdditional options for this fetch
join():Promise<AnyThreadChannel>
Makes the client user join the thread.
leave():Promise<AnyThreadChannel>
Makes the client user leave the thread.
permissionsFor(memberOrRole, checkAdmin?):Readonly<PermissionsBitField>
Gets the overall set of permissions for a member or role in this thread's parent channel, taking overwrites into account.
Returns
NameTypeOptionalDescription
memberOrRoleGuildMember | RoleNoThe member or role to obtain the overall permissions for
checkAdminbooleanYesWhether having the permission will return all permissions
pin(reason?):Promise<ThreadChannel<true>>
Pins this thread from the forum channel (only applicable to forum threads).
NameTypeOptionalDescription
reasonstringYesReason for pinning
setAppliedTags(appliedTags, reason?):Promise<ThreadChannel<true>>
Set the applied tags for this channel (only applicable to forum threads)
NameTypeOptionalDescription
appliedTagsSnowflake[]NoThe tags to set for this channel
reasonstringYesReason for changing the thread's applied tags
setArchived(archived?, reason?):Promise<AnyThreadChannel>
Sets whether the thread is archived.
NameTypeOptionalDescription
archivedbooleanYesWhether the thread is archived
reasonstringYesReason for archiving or unarchiving
setAutoArchiveDuration(autoArchiveDuration, reason?):Promise<AnyThreadChannel>
Sets the duration after which the thread will automatically archive in case of no recent activity.
NameTypeOptionalDescription
autoArchiveDurationThreadAutoArchiveDurationNoThe amount of time after which the thread should automatically archive in case of no recent activity
reasonstringYesReason for changing the auto archive duration
setInvitable(invitable?, reason?):Promise<AnyThreadChannel>
Sets whether members without the permission can invite other members to this thread.
NameTypeOptionalDescription
invitablebooleanYesWhether non-moderators can invite non-moderators to this thread
reasonstringYesReason for changing invite
setLocked(locked?, reason?):Promise<AnyThreadChannel>
Sets whether the thread can be **unarchived** by anyone with the permission. When a thread is locked, only members with the permission can unarchive it.
NameTypeOptionalDescription
lockedbooleanYesWhether the thread is locked
reasonstringYesReason for locking or unlocking the thread
setName(name, reason?):Promise<AnyThreadChannel>
Sets a new name for this thread.
NameTypeOptionalDescription
namestringNoThe new name for the thread
reasonstringYesReason for changing the thread's name
toString():ChannelMention
When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
unpin(reason?):Promise<ThreadChannel<true>>
Unpins this thread from the forum channel (only applicable to forum threads).
NameTypeOptionalDescription
reasonstringYesReason for unpinning