GuildForumThreadManager

export class GuildForumThreadManager extends ThreadManager<true>
export class GuildForumThreadManager extends ThreadManager<true>
Manages API methods for threads in forum channels and stores their cache.

Extends

ThreadManager<true>
Readonly
cache:Collection<Key, Holds>
The cache of items for this manager.
Inherited from DataManager
The channel this Manager belongs to
Inherited from ThreadManager
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
create(options):Promise<ForumThreadChannel>
Creates a new thread in the channel.
Example
// Create a new forum post
forum.threads
.create({
name: 'Food Talk',
autoArchiveDuration: ThreadAutoArchiveDuration.OneHour,
message: {
content: 'Discuss your favorite food!',
},
reason: 'Needed a separate thread for food',
})
.then(threadChannel => console.log(threadChannel))
.catch(console.error);
// Create a new forum post
forum.threads
.create({
name: 'Food Talk',
autoArchiveDuration: ThreadAutoArchiveDuration.OneHour,
message: {
content: 'Discuss your favorite food!',
},
reason: 'Needed a separate thread for food',
})
.then(threadChannel => console.log(threadChannel))
.catch(console.error);
NameTypeOptionalDescription
optionsGuildForumThreadCreateOptionsNoOptions to create a new thread
fetch(options, cacheOptions?):Promise<If<ThreadOnly, ForumThreadChannel, TextThreadChannel> | null>
Obtains a thread from Discord, or the channel cache if it's already available.
Returns
FetchedThreads if active & FetchedThreadsMore if archived.
Example
// Fetch a thread by its id
channel.threads.fetch('831955138126104859')
.then(channel => console.log(channel.name))
.catch(console.error);
// Fetch a thread by its id
channel.threads.fetch('831955138126104859')
.then(channel => console.log(channel.name))
.catch(console.error);
NameTypeOptionalDescription
optionsThreadChannelResolvableNoThe options to fetch threads. If it is a ThreadChannelResolvable then the specified thread will be fetched. Fetches all active threads if undefined
cacheOptionsBaseFetchOptionsYesAdditional options for this fetch. The force field gets ignored if options is not a ThreadChannelResolvable
fetchActive(cache?):Promise<FetchedThreads>
Obtains all active threads in the channel.
NameTypeOptionalDescription
cachebooleanYesWhether to cache the fetched data
Inherited from ThreadManager
fetchArchived(options?, cache?):Promise<FetchedThreadsMore>
Obtains a set of archived threads from Discord. This method requires the PermissionFlagsBits.ReadMessageHistory permission in the parent channel.
NameTypeOptionalDescription
optionsFetchArchivedThreadOptionsYesThe options to fetch archived threads
cachebooleanYesWhether to cache the new thread objects if they aren't already
Inherited from ThreadManager
resolve(thread):ThreadChannel | null
Resolves a ThreadChannelResolvable to a object.
NameTypeOptionalDescription
threadThreadChannelResolvableNoThe ThreadChannel resolvable to resolve
Inherited from ThreadManager
resolveId(thread):Snowflake | null
Resolves a ThreadChannelResolvable to a id.
NameTypeOptionalDescription
threadThreadChannelResolvableNoThe ThreadChannel resolvable to resolve
Inherited from ThreadManager
valueOf():Collection<Key, Holds>