mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
docs: Update threads to use ThreadAutoArchiveDuration (#8153)
This commit is contained in:
@@ -83,7 +83,7 @@ class ThreadManager extends CachedManager {
|
||||
* channel.threads
|
||||
* .create({
|
||||
* name: 'food-talk',
|
||||
* autoArchiveDuration: 60,
|
||||
* autoArchiveDuration: ThreadAutoArchiveDuration.OneHour,
|
||||
* reason: 'Needed a separate thread for food',
|
||||
* })
|
||||
* .then(threadChannel => console.log(threadChannel))
|
||||
@@ -93,7 +93,7 @@ class ThreadManager extends CachedManager {
|
||||
* channel.threads
|
||||
* .create({
|
||||
* name: 'mod-talk',
|
||||
* autoArchiveDuration: 60,
|
||||
* autoArchiveDuration: ThreadAutoArchiveDuration.OneHour,
|
||||
* type: ChannelType.GuildPrivateThread,
|
||||
* reason: 'Needed a separate thread for moderation',
|
||||
* })
|
||||
|
||||
@@ -69,7 +69,7 @@ class BaseGuildTextChannel extends GuildChannel {
|
||||
if ('default_auto_archive_duration' in data) {
|
||||
/**
|
||||
* The default auto archive duration for newly created threads in this channel
|
||||
* @type {?number}
|
||||
* @type {?ThreadAutoArchiveDuration}
|
||||
*/
|
||||
this.defaultAutoArchiveDuration = data.default_auto_archive_duration;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class ThreadChannel extends Channel {
|
||||
|
||||
/**
|
||||
* The amount of time (in minutes) after which the thread will automatically archive in case of no recent activity
|
||||
* @type {?number}
|
||||
* @type {?ThreadAutoArchiveDuration}
|
||||
*/
|
||||
this.autoArchiveDuration = data.thread_metadata.auto_archive_duration;
|
||||
|
||||
@@ -350,7 +350,7 @@ class ThreadChannel extends Channel {
|
||||
* @returns {Promise<ThreadChannel>}
|
||||
* @example
|
||||
* // Set the thread's auto archive time to 1 hour
|
||||
* thread.setAutoArchiveDuration(60)
|
||||
* thread.setAutoArchiveDuration(ThreadAutoArchiveDuration.OneHour)
|
||||
* .then(newThread => {
|
||||
* console.log(`Thread will now archive after ${newThread.autoArchiveDuration} minutes of inactivity`);
|
||||
* });
|
||||
|
||||
Reference in New Issue
Block a user