class ThreadManager
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.
Constructors
channel: TextChannel | NewsChannel | ForumChannel | MediaChanneliterable?: Iterable<RawThreadChannelData>)
constructor(Constructs a new instance of the ThreadManager
class
Collection<Snowflake, ThreadChannel> cache :
The cache of this Manager
If<ThreadOnly, ForumChannel | MediaChannel, TextChannel | NewsChannel> channel :
The channel this Manager belongs to
readonlyClient client :
The client that instantiated this Manager
readonlyConstructable<Holds> holds :
The data structure belonging to this manager.
Inherited from: DataManager
fetchoptions: ThreadChannelResolvablecacheOptions?: BaseFetchOptions) : Promise<AnyThreadChannel | 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