ThreadsAPI
declare class ThreadsAPI declare class ThreadsAPI No summary provided.
constructor(rest)
Constructs a new instance of the
ThreadsAPI class| Name | Type | Optional | Description |
|---|---|---|---|
| rest | REST | No | None |
addMember(threadId, userId)
:
Promise<void>
Adds a member to a thread
| Name | Type | Optional | Description |
|---|---|---|---|
| threadId | Snowflake | No | The id of the thread to add the member to |
| userId | Snowflake | No | The id of the user to add to the thread |
create(channelId, { message_id, ...body })
:
Promise<discord_api_types_v10.APIChannel>
Creates a new thread
| Name | Type | Optional | Description |
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to start the thread in |
| { message_id, ...body } | StartThreadOptions | No | None |
createForumThread(channelId, { message, ...optionsBody })
:
Promise<APIThreadChannel>
Creates a new forum post
| Name | Type | Optional | Description |
|---|---|---|---|
| channelId | Snowflake | No | The id of the forum channel to start the thread in |
| { message, ...optionsBody } | StartForumThreadOptions | No | None |
get(channelId, threadId)
:
Promise<APIThreadChannel>
Fetches a thread
| Name | Type | Optional | Description |
|---|---|---|---|
| channelId | Snowflake | No | The id of the channel to fetch the thread from |
| threadId | Snowflake | No | The id of the thread |
getAllMembers(threadId)
:
Promise<RESTGetAPIChannelThreadMembersResult>
Fetches all members of a thread
| Name | Type | Optional | Description |
|---|---|---|---|
| threadId | Snowflake | No | The id of the thread to fetch the members from |
getMember(threadId, userId)
:
Promise<APIThreadMember>
Fetches a member of a thread
| Name | Type | Optional | Description |
|---|---|---|---|
| threadId | Snowflake | No | The id of the thread to fetch the member from |
| userId | Snowflake | No | The id of the user |
join(threadId)
:
Promise<void>
Adds the current user to a thread
| Name | Type | Optional | Description |
|---|---|---|---|
| threadId | Snowflake | No | The id of the thread to join |
leave(threadId)
:
Promise<void>
Removes the current user from a thread
| Name | Type | Optional | Description |
|---|---|---|---|
| threadId | Snowflake | No | The id of the thread to leave |
removeMember(threadId, userId)
:
Promise<void>
Removes a member from a thread
| Name | Type | Optional | Description |
|---|---|---|---|
| threadId | Snowflake | No | The id of the thread to remove the member from |
| userId | Snowflake | No | The id of the user to remove from the thread |