export declare class ThreadsAPI
export declare class ThreadsAPI
No summary provided.
constructor(rest)
Constructs a new instance of the
ThreadsAPI
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
addMember(threadId, userId, { signal }?)
:
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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
create(channelId, body, messageId?, { signal }?)
:
Promise<APIChannel>
Creates a new thread
Name | Type | Optional | Description |
---|---|---|---|
channelId | Snowflake | No | The id of the channel to start the thread in |
body | RESTPostAPIChannelThreadsJSONBody | No | The data to use when starting the thread |
messageId | Snowflake | Yes | The id of the message to start the thread from |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
createForumThread(channelId, { message, ...optionsBody }, { signal }?)
:
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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
get(threadId, { signal }?)
:
Promise<APIThreadChannel>
Fetches a thread
Name | Type | Optional | Description |
---|---|---|---|
threadId | Snowflake | No | The id of the thread |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getAllMembers(threadId, { signal }?)
:
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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getMember(threadId, userId, { signal }?)
:
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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
join(threadId, { signal }?)
:
Promise<void>
Adds the current user to a thread
Name | Type | Optional | Description |
---|---|---|---|
threadId | Snowflake | No | The id of the thread to join |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
leave(threadId, { signal }?)
:
Promise<void>
Removes the current user from a thread
Name | Type | Optional | Description |
---|---|---|---|
threadId | Snowflake | No | The id of the thread to leave |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
removeMember(threadId, userId, { signal }?)
:
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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |