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

Constructs a new instance of the ThreadManager class

Type Parameters

optional
ThreadOnly? extends boolean = boolean

readonly
cache : 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

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

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>

Obtains all active threads in the channel.

fetchArchived() : Promise<FetchedThreadsMore>

Obtains a set of archived threads from Discord. This method requires the PermissionFlagsBits.ReadMessageHistory permission in the parent channel.

valueOf() : Collection<Key, Holds>

Inherited from: DataManager