class ThreadManager

export class ThreadManager<ThreadOnly extends boolean = boolean> extends CachedManager< Snowflake, ThreadChannel<ThreadOnly>, ThreadChannelResolvable>

Manages API methods for thread-based channels and stores their cache.


Constructs a new instance of the ThreadManager class

Type Parameters

ThreadOnly? extends boolean = boolean

The cache of this Manager

channel : If<ThreadOnly, ForumChannel | MediaChannel, TextChannel | NewsChannel>

The channel this Manager belongs to

client : Client

The client that instantiated this Manager

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.

// Fetch a thread by its id
  .then(channel => console.log(

Returns: FetchedThreads if active & FetchedThreadsMore if archived.

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