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.

Constructors

Constructs a new instance of the ThreadManager class

Type Parameters

optional
ThreadOnly? extends boolean = boolean

The cache of this Manager

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

The channel this Manager belongs to

readonly
client : Client

The client that instantiated this Manager

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