Skip to content

ThreadMemberManager

ThreadMemberManager ⇐ Base

Manages the members of a thread in a guild.

Kind: global class
Extends: Base

new ThreadMemberManager(guildId, threadId, client)

Constructs a new instance of the ThreadWatcher class.

ParamTypeDescription
guildIdstringThe ID of the guild the thread belongs to.
threadIdstringThe ID of the thread.
clientClientThe client instance.

threadMemberManager.cache ⇒

Getter method for the cache property.

Kind: instance property of ThreadMemberManager
Returns: The Collection object representing the cache.

threadMemberManager._add(members, [guildId], [threadId], [options])

Adds a member to a thread.

Kind: instance method of ThreadMemberManager

ParamTypeDefaultDescription
membersstring | ObjectThe member or user ID to add to the thread.
[guildId]string”this.guildId”The ID of the guild where the thread is located.
[threadId]string”this.threadId”The ID of the thread.
[options]object{ cache: true, force: false }Additional options for adding the member.
[options.cache]booleantrueWhether to cache the thread member.
[options.force]booleanfalseWhether to force fetching the thread member even if it is already cached.

threadMemberManager.join() ⇒ Promise.<void>

Joins the current user to a thread in a channel.

Kind: instance method of ThreadMemberManager
Returns: Promise.<void> - - A promise that resolves when the user has successfully joined the thread.

threadMemberManager.fetch(user, [options]) ⇒ Promise

Fetches data for a user or thread from the server.

Kind: instance method of ThreadMemberManager
Returns: Promise - A promise that resolves with the fetched data.

ParamTypeDefaultDescription
userstring | objectThe user ID or object containing user information.
[options]objectAdditional options for the fetch request.
[options.cache]booleantrueWhether to cache the fetched data.
[options.force]booleanfalseWhether to force a fresh fetch from the server.

threadMemberManager._fetchId(user, [cache], [force]) ⇒ Promise.<string>

Fetches the ID of a user asynchronously.

Kind: instance method of ThreadMemberManager
Returns: Promise.<string> - A promise that resolves to the user ID.

ParamTypeDefaultDescription
userstring | UserObjectThe user or user ID to fetch the ID for.
[cache]booleantrueWhether to cache the fetched ID.
[force]booleantrueWhether to force the fetch even if the ID is already cached.

threadMemberManager.add([user]) ⇒ Promise.<void>

Adds a user to the thread.

Kind: instance method of ThreadMemberManager
Returns: Promise.<void> - - A promise that resolves when the user has been added to the thread.

ParamTypeDefaultDescription
[user]string | User”this.client.user.id”The user to add to the thread. Can be a user ID or a User object.

threadMemberManager.remove([user]) ⇒ Promise.<(GuildMember|null)>

Removes a user from the thread.

Kind: instance method of ThreadMemberManager
Returns: Promise.<(GuildMember|null)> - - A promise that resolves with the deleted member object, or null if the user was not found.

ParamTypeDefaultDescription
[user]string | UserResolvable”this.client.user.id”The user to remove from the thread. Defaults to the client’s user ID.