class ThreadManager
extends
CachedManager<Snowflake, If<ThreadOnly, ForumThreadChannel, TextThreadChannel>, ThreadChannelResolvable>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
channel: TextChannel | NewsChannel | ForumChannel | MediaChanneliterable?: Iterable<RawThreadChannelData>)
constructor(Constructs a new instance of the ThreadManager
class
readonlyCollection<Key, Holds> cache :
The cache of items for this manager.
Inherited from: DataManager
If<ThreadOnly, ForumChannel | MediaChannel, TextChannel | NewsChannel> channel :
The channel this Manager belongs to
readonlyConstructable<Holds> holds :
The data structure belonging to this manager.
Inherited from: DataManager
fetchoptions: ThreadChannelResolvablecacheOptions?: BaseFetchOptions) : Promise<If<ThreadOnly, ForumThreadChannel, TextThreadChannel> | null> (
Obtains a thread from Discord, or the channel cache if it's already available.
// 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.
fetchActivecache?: boolean) : Promise<FetchedThreads> (
Obtains all active threads in the channel.
fetchArchivedoptions?: FetchArchivedThreadOptionscache?: boolean) : Promise<FetchedThreadsMore> (
Obtains a set of archived threads from Discord. This method requires the PermissionFlagsBits.ReadMessageHistory permission in the parent channel.
resolvethread: ThreadChannelResolvable) : ThreadChannel (
Resolves a ThreadChannelResolvable to a ThreadChannel object.
resolveIdthread: ThreadChannelResolvable) : Snowflake (
Resolves a ThreadChannelResolvable to a ThreadChannel id.
valueOfCollection<Key, Holds> () :
Inherited from: DataManager