Class

ThreadChannel

A thread inside a text, announcement, forum, or media channel. Threads are text-capable channels: use send the same way as a text channel.

Extends TextCapable(GuildChannel)

Constructor

new ThreadChannel(client: Client, data: APIChannel)
client
Client

Properties

NameTypeDescription
appliedTagsstring[]Tag IDs applied to a forum or media post.
archivedbooleanWhether the thread is archived.
archiveTimestampstring | nullISO-8601 timestamp when the archive status last changed.
autoArchiveDurationnumberMinutes of inactivity before the thread archives.
flagsnumberChannel flags bitfield.
invitableboolean | nullWhether non-moderators can add other non-moderators. Private threads only.
lastMessageIdstring | nullID of the last message sent in this thread.
lockedbooleanWhether only moderators can unarchive the thread.
memberThreadMember | nullThe current user's membership, when the payload included it.
memberCountnumberApproximate member count, capped at 50.
membersread-onlyThreadMemberManagerAdd, remove, and list members of this thread.
messageCountnumberMessages in the thread, excluding the starter and deleted messages.
ownerIdstring | nullUser who created the thread.
parentIdstring | nullParent channel ID.
rateLimitPerUsernumberSlowmode in seconds.
totalMessageSentnumberMessages ever sent in the thread. This count is never decremented.

Methods

.edit(options)

options: ThreadEditOptions | ChannelEditOptions → Promise<this>

Edit this thread. Requires Manage Threads on public threads, or ownership on private ones. appliedTags is sent for public and announcement threads. invitable is sent for private threads.

await message.thread.edit(options);

.join()

→ Promise<void>

Join this thread.

await message.thread.join();

.leave()

→ Promise<void>

Leave this thread.

await message.thread.leave();

.setArchived(archived, reason?)

archived: boolean, reason?: string → Promise<this>

Archive or unarchive this thread.

await message.thread.setArchived(archived);

.setLocked(locked, reason?)

locked: boolean, reason?: string → Promise<this>

Lock or unlock this thread. Locked threads can only be unarchived by moderators.

await message.thread.setLocked(locked);