class GuildTextThreadManager
extends
ThreadManager<false>export class GuildTextThreadManager<AllowedThreadType> extends ThreadManager<false>
Manages API methods for ThreadChannel objects and stores their cache.
Type Parameters
AllowedThreadType
readonlyCollection<Key, Holds> cache :
The cache of items for this manager.
Inherited from: DataManager
If<false, ForumChannel | MediaChannel, TextChannel | AnnouncementChannel> channel :
The channel this Manager belongs to
Inherited from: ThreadManager
readonlyConstructable<Holds> holds :
The data structure belonging to this manager.
Inherited from: DataManager
create) : Promise<AllowedThreadType extends ChannelType.PrivateThread ? PrivateThreadChannel : PublicThreadChannel<false>> (
Creates a new thread in the channel.
// Create a new public thread
channel.threads
.create({
name: 'food-talk',
autoArchiveDuration: ThreadAutoArchiveDuration.OneHour,
reason: 'Needed a separate thread for food',
})
.then(threadChannel => console.log(threadChannel))
.catch(console.error);
// Create a new private thread
channel.threads
.create({
name: 'mod-talk',
autoArchiveDuration: ThreadAutoArchiveDuration.OneHour,
type: ChannelType.PrivateThread,
reason: 'Needed a separate thread for moderation',
})
.then(threadChannel => console.log(threadChannel))
.catch(console.error);
fetchoptions: ThreadChannelResolvablecacheOptions?: BaseFetchOptions) : Promise<If<ThreadOnly, ForumThreadChannel, TextThreadChannel> | null> (
Obtains a thread from Discord, or the channel cache if it's already available.
// 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> (
Obtains all active threads in the channel.
Inherited from: ThreadManager
fetchArchivedoptions?: FetchArchivedThreadOptionscache?: boolean = true) : Promise<FetchedThreadsMore> (
Obtains a set of archived threads from Discord. This method requires the permission in the parent channel.
Inherited from: ThreadManager
resolvethread: ThreadChannelResolvable) : ThreadChannel | null (
Resolves a ThreadChannelResolvable to a ThreadChannel object.
Inherited from: ThreadManager
resolveIdthread: ThreadChannelResolvable) : Snowflake | null (
Resolves a ThreadChannelResolvable to a ThreadChannel id.
Inherited from: ThreadManager
valueOfCollection<Key, Holds> () :
Inherited from: DataManager