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 | AnnouncementChannel | ForumChannel | MediaChanneliterable?: Iterable<RawThreadChannelData>)
constructor(channel: TextChannel | AnnouncementChannel | ForumChannel | MediaChannel
iterable?: Iterable<RawThreadChannelData>
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 | AnnouncementChannel> channel :
The channel this Manager belongs to
readonlyConstructable<Holds> holds :
The data structure belonging to this manager.
Inherited from: DataManager
Overload 1
Overload 2
Overload 3
fetchoptions: 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.
fetchActivecache?: boolean = true) : Promise<FetchedThreads> (
cache?: boolean = true
Obtains all active threads in the channel.
fetchArchivedoptions?: FetchArchivedThreadOptionscache?: boolean = true) : Promise<FetchedThreadsMore> (
options?: FetchArchivedThreadOptions
cache?: boolean = true
Obtains a set of archived threads from Discord. This method requires the permission in the parent channel.
resolvethread: ThreadChannelResolvable) : ThreadChannel | null (
thread: ThreadChannelResolvable
Resolves a ThreadChannelResolvable to a ThreadChannel object.
resolveIdthread: ThreadChannelResolvable) : Snowflake | null (
thread: ThreadChannelResolvable
Resolves a ThreadChannelResolvable to a ThreadChannel id.
valueOfCollection<Key, Holds> () :
Inherited from: DataManager