docs: Update threads to use ThreadAutoArchiveDuration (#8153)

This commit is contained in:
Jiralite
2022-06-22 19:34:41 +01:00
committed by GitHub
parent c34c02ab8d
commit ee36d60dc6
3 changed files with 5 additions and 5 deletions

View File

@@ -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',
* })

View File

@@ -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;
}

View File

@@ -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`);
* });