ThreadManager

export class ThreadManager<ThreadOnly extends boolean = boolean> extends CachedManager<
Snowflake,
ThreadChannel<ThreadOnly>,
ThreadChannelResolvable
>
export class ThreadManager<ThreadOnly extends boolean = boolean> extends CachedManager<
Snowflake,
ThreadChannel<ThreadOnly>,
ThreadChannelResolvable
>
Manages API methods for thread-based channels and stores their cache.
NameConstraintsOptionalDefaultDescription
ThreadOnlybooleanYesbooleanNone
constructor(channel, iterable?)
Constructs a new instance of the ThreadManager class
NameTypeOptionalDescription
channelTextChannel | NewsChannel | ForumChannel | MediaChannelNoNone
iterableIterable<RawThreadChannelData>YesNone
Readonly
cache:Collection<K, Holds>
The cache of items for this manager.
Inherited from DataManager
The channel this Manager belongs to
Readonly
client:Client
The client that instantiated this Manager
Inherited from BaseManager
Readonly
holds:Constructable<Holds>
The data structure belonging to this manager.
Inherited from DataManager
fetch(options, cacheOptions?):Promise<AnyThreadChannel | null>
Obtains a thread from Discord, or the channel cache if it's already available.
Returns
FetchedThreads if active & FetchedThreadsMore if archived.
NameTypeOptionalDescription
optionsThreadChannelResolvableNoThe options to fetch threads. If it is a ThreadChannelResolvable then the specified thread will be fetched. Fetches all active threads if undefined
cacheOptionsBaseFetchOptionsYesAdditional options for this fetch. The force field gets ignored if options is not a ThreadChannelResolvable
fetchActive(cache?):Promise<FetchedThreads>
Obtains all active threads in the channel.
NameTypeOptionalDescription
cachebooleanYesWhether to cache the fetched data
fetchArchived(options?, cache?):Promise<FetchedThreadsMore>
Obtains a set of archived threads from Discord. This method requires the permission in the parent channel.
NameTypeOptionalDescription
optionsFetchArchivedThreadOptionsYesThe options to fetch archived threads
cachebooleanYesWhether to cache the new thread objects if they aren't already
resolve(idOrInstance):Holds
Resolves a data entry to a data Object.
Returns
An instance from this Manager
NameTypeOptionalDescription
idOrInstanceHoldsNoThe id or instance of something in this Manager
resolveId(idOrInstance):K
Resolves a data entry to an instance id.
Returns
NameTypeOptionalDescription
idOrInstanceK | HoldsNoThe id or instance of something in this Manager
valueOf():Collection<K, Holds>