BaseThreadManager
BaseThreadManager ⇐ Base
Section titled “BaseThreadManager ⇐ Base”Represents a base thread manager that handles operations related to thread channels.
Kind: global class
Extends: Base
- BaseThreadManager ⇐
Base- new BaseThreadManager(client)
- .cache ⇒
- ._add(threads, [guildId], [options]) ⇒
ThreadChannel|null - .create(message, options)
- .fetch(thread, [options]) ⇒
Promise - .fetchActive() ⇒
Promise.<FetchedThreads> - .fetchArchivedThread([options]) ⇒
Promise.<FetchedThreads> - .fetchForumThreads([query]) ⇒
Promise.<Object>
new BaseThreadManager(client)
Section titled “new BaseThreadManager(client)”Constructs a new instance of the class.
| Param | Type | Description |
|---|---|---|
| client | Client | The client object used for communication with the server. |
baseThreadManager.cache ⇒
Section titled “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
Section titled “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.
| Param | Type | Default | Description |
|---|---|---|---|
| threads | string | ThreadChannelResolvable | The thread or thread ID to add. | |
| [guildId] | Snowflake | this.guildId | The ID of the guild where the thread belongs. |
| [options] | Object | Additional options for adding the thread. | |
| [options.cache] | boolean | true | Whether to cache the thread. |
| [options.force] | boolean | true | Whether to force adding the thread even if it already exists in the cache. |
baseThreadManager.create(message, options)
Section titled “baseThreadManager.create(message, options)”Creates a new thread in the current channel with the given message and options.
Kind: instance method of BaseThreadManager
| Param | Type | Description |
|---|---|---|
| message | string | object | The message content or message object to start the thread with. |
| options | object | The options for creating the thread. |
| [options.reason] | string | The reason for creating the thread. |
| [options.name] | string | The name of the thread. |
| [options.type] | string | number | The type of the thread. Can be a string or number. |
| [options.invitable] | boolean | Whether the thread is invitable. |
| [options.autoArchiveDuration] | number | The auto archive |
baseThreadManager.fetch(thread, [options]) ⇒ Promise
Section titled “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.
| Param | Type | Description |
|---|---|---|
| thread | string | The ID of the thread to fetch. |
| [options] | Object | Additional options for the fetch request. |
baseThreadManager.fetchActive() ⇒ Promise.<FetchedThreads>
Section titled “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>
Section titled “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.
| Param | Type | Default | Description |
|---|---|---|---|
| [options] | Object | The options for fetching archived threads. | |
| [options.before] | Date | The date before which the threads should be fetched. | |
| [options.limit] | number | 25 | The maximum number of threads to fetch. |
| [options.public] | boolean | false | Whether to fetch public or private archived threads. |
baseThreadManager.fetchForumThreads([query]) ⇒ Promise.<Object>
Section titled “baseThreadManager.fetchForumThreads([query]) ⇒ Promise.<Object>”Fetches forum threads based on the provided query parameters.
Kind: instance method of BaseThreadManager
| Param | Type | Default | Description |
|---|---|---|---|
| [query] | Object | The query parameters for fetching forum threads. | |
| [query.archived] | boolean | Whether to include archived threads. | |
| [query.sortBy] | string | ”"last_message_time"“ | The field to sort the threads by. |
| [query.sortOrder] | string | ”"desc"“ | The order in which to sort the threads. |
| [query.limit] | number | 25 | The maximum number of threads to fetch. |
| [query.offset] | number | 50 | The offset from which to start fetching threads. |