ThreadChannel
- class ThreadChannel()
A temporary sub-channel within a guild text or forum channel.
exported from
lib.weeble.d- Extends:
Properties
- ThreadChannel.ownerId
type: readonly string | null | undefined
ID of the member who created this thread, or
null.
- ThreadChannel.parentId
type: readonly string | null | undefined
ID of the parent channel, or
nullif not available.
- ThreadChannel.type
type: readonly 10 | 11 | 12
The type of this channel — use this to narrow to the correct subclass.
Methods
- async ThreadChannel.addThreadMember(userId: string) Promise<void>
Add a member to this thread.
- Parameters:
userId — – The ID of the user to add.
-
async ThreadChannel.archive(reason: string) Promise<
ThreadChannel> Archive this thread.
- Parameters:
reason — – Audit-log reason for archiving the thread.
- Returns:
The archived thread.
-
async ThreadChannel.edit(options:
ThreadChannelEditOptions) Promise<ThreadChannel> Edit thread properties.
- Parameters:
options — – Thread fields to update. Omitted fields are left unchanged.
- Returns:
The updated thread.
-
async ThreadChannel.fetchMessages(options:
FetchMessagesOptions) Promise<Message[]> Fetch recent messages with optional pagination.
- Parameters:
options — – Optional pagination parameters.
- Returns:
Array of messages.
-
async ThreadChannel.fetchPins(options: { before?: string | Date; limit?: number; }) Promise<
PinPage> Fetch a page of pinned messages with Discord’s cursor-based pins API.
- async ThreadChannel.fetchThreadMembers() Promise<{ id: string; joinedAt: Date | null; userId: string; }[]>
Fetch members participating in this thread.
- Returns:
Array of thread member objects.
-
async ThreadChannel.getMessage(messageId: string) Promise<
Message| null> Fetch a specific message by ID, or
nullif not found.- Parameters:
messageId — – The ID of the message to fetch.
- Returns:
The message, or null if not found.
- async ThreadChannel.removeThreadMember(userId: string) Promise<void>
Remove a member from this thread.
- Parameters:
userId — – The ID of the user to remove.
-
async ThreadChannel.send(content: string |
SendMessageOptions) Promise<Message> Send a message in this thread.
- Parameters:
content — – The message content or send options.
- Returns:
The sent message.
-
async ThreadChannel.unarchive(reason: string) Promise<
ThreadChannel> Unarchive this thread (re-open it).
- Parameters:
reason — – Audit-log reason for unarchiving the thread.
- Returns:
The unarchived thread.