export class ThreadManager<ThreadOnly extends boolean = boolean> extends CachedManager<Snowflake, If<ThreadOnly, ForumThreadChannel, TextThreadChannel>, ThreadChannelResolvable>Manages API methods for thread-based channels and stores their cache.
Constructors
constructor(channel: TextChannel | NewsChannel | ForumChannel | MediaChanneliterable?: Iterable<RawThreadChannelData>)
channel: TextChannel | NewsChannel | ForumChannel | MediaChannel
iterable?: Iterable<RawThreadChannelData>
Constructs a new instance of the ThreadManager class
readonlycache : Collection<Key, Holds>
The cache of items for this manager.
Inherited from: DataManager
channel : If<ThreadOnly, ForumChannel | MediaChannel, TextChannel | NewsChannel>
The channel this Manager belongs to
readonlyholds : Constructable<Holds>
The data structure belonging to this manager.
Inherited from: DataManager
Overload 1
Overload 2
Overload 3
fetch(options: ThreadChannelResolvablecacheOptions?: BaseFetchOptions) : Promise<If<ThreadOnly, ForumThreadChannel, TextThreadChannel> | null>
options: ThreadChannelResolvable
cacheOptions?: BaseFetchOptions
Obtains a thread from Discord, or the channel cache if it's already available.
Examples:
// Fetch a thread by its id
channel.threads.fetch('831955138126104859')
.then(channel => console.log(channel.name))
.catch(console.error);Returns: FetchedThreads if active & FetchedThreadsMore if archived.
fetchActive(cache?: boolean) : Promise<FetchedThreads>
cache?: boolean
Obtains all active threads in the channel.
fetchArchived(options?: FetchArchivedThreadOptionscache?: boolean) : Promise<FetchedThreadsMore>
options?: FetchArchivedThreadOptions
cache?: boolean
Obtains a set of archived threads from Discord. This method requires the permission in the parent channel.
resolve(thread: ThreadChannelResolvable) : ThreadChannel | null
thread: ThreadChannelResolvable
Resolves a ThreadChannelResolvable to a ThreadChannel object.
resolveId(thread: ThreadChannelResolvable) : Snowflake | null
thread: ThreadChannelResolvable
Resolves a ThreadChannelResolvable to a ThreadChannel id.
valueOf() : Collection<Key, Holds>
Inherited from: DataManager