Skip to content

BaseThreadManager

BaseThreadManager ⇐ Base

Represents a base thread manager that handles operations related to thread channels.

Kind: global class
Extends: Base

new BaseThreadManager(client)

Constructs a new instance of the class.

ParamTypeDescription
clientClientThe client object used for communication with the server.

baseThreadManager.cache ⇒

Getter method for the cache property.

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

baseThreadManager._add(threads, [guildId], [options]) ⇒ ThreadChannel | null

Adds a thread to the guild’s thread cache.

Kind: instance method of BaseThreadManager
Returns: ThreadChannel | null - The added thread or null if no thread is provided.

ParamTypeDefaultDescription
threadsstring | ThreadChannelResolvableThe thread or thread ID to add.
[guildId]Snowflakethis.guildIdThe ID of the guild where the thread belongs.
[options]ObjectAdditional options for adding the thread.
[options.cache]booleantrueWhether to cache the thread.
[options.force]booleantrueWhether to force adding the thread even if it already exists in the cache.

baseThreadManager.create(message, options)

Creates a new thread in the current channel with the given message and options.

Kind: instance method of BaseThreadManager

ParamTypeDescription
messagestring | objectThe message content or message object to start the thread with.
optionsobjectThe options for creating the thread.
[options.reason]stringThe reason for creating the thread.
[options.name]stringThe name of the thread.
[options.type]string | numberThe type of the thread. Can be a string or number.
[options.invitable]booleanWhether the thread is invitable.
[options.autoArchiveDuration]numberThe auto archive

baseThreadManager.fetch(thread, [options]) ⇒ Promise

Fetches a thread from the client’s channels.

Kind: instance method of BaseThreadManager
Returns: Promise - A promise that resolves to the fetched thread.

ParamTypeDescription
threadstringThe ID of the thread to fetch.
[options]ObjectAdditional options for the fetch request.

baseThreadManager.fetchActive() ⇒ Promise.<FetchedThreads>

Fetches the active threads for the current guild.

Kind: instance method of BaseThreadManager
Returns: Promise.<FetchedThreads> - - A promise that resolves to a FetchedThreads object containing the active threads.

baseThreadManager.fetchArchivedThread([options]) ⇒ Promise.<FetchedThreads>

Fetches archived threads based on the provided options.

Kind: instance method of BaseThreadManager
Returns: Promise.<FetchedThreads> - - A promise that resolves to a FetchedThreads object containing the fetched threads.

ParamTypeDefaultDescription
[options]ObjectThe options for fetching archived threads.
[options.before]DateThe date before which the threads should be fetched.
[options.limit]number25The maximum number of threads to fetch.
[options.public]booleanfalseWhether to fetch public or private archived threads.

baseThreadManager.fetchForumThreads([query]) ⇒ Promise.<Object>

Fetches forum threads based on the provided query parameters.

Kind: instance method of BaseThreadManager

ParamTypeDefaultDescription
[query]ObjectThe query parameters for fetching forum threads.
[query.archived]booleanWhether to include archived threads.
[query.sortBy]string”&quot;last_message_time&quot;“The field to sort the threads by.
[query.sortOrder]string”&quot;desc&quot;“The order in which to sort the threads.
[query.limit]number25The maximum number of threads to fetch.
[query.offset]number50The offset from which to start fetching threads.