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 * channel.threads
* .create({ * .create({
* name: 'food-talk', * name: 'food-talk',
* autoArchiveDuration: 60, * autoArchiveDuration: ThreadAutoArchiveDuration.OneHour,
* reason: 'Needed a separate thread for food', * reason: 'Needed a separate thread for food',
* }) * })
* .then(threadChannel => console.log(threadChannel)) * .then(threadChannel => console.log(threadChannel))
@@ -93,7 +93,7 @@ class ThreadManager extends CachedManager {
* channel.threads * channel.threads
* .create({ * .create({
* name: 'mod-talk', * name: 'mod-talk',
* autoArchiveDuration: 60, * autoArchiveDuration: ThreadAutoArchiveDuration.OneHour,
* type: ChannelType.GuildPrivateThread, * type: ChannelType.GuildPrivateThread,
* reason: 'Needed a separate thread for moderation', * reason: 'Needed a separate thread for moderation',
* }) * })

View File

@@ -69,7 +69,7 @@ class BaseGuildTextChannel extends GuildChannel {
if ('default_auto_archive_duration' in data) { if ('default_auto_archive_duration' in data) {
/** /**
* The default auto archive duration for newly created threads in this channel * The default auto archive duration for newly created threads in this channel
* @type {?number} * @type {?ThreadAutoArchiveDuration}
*/ */
this.defaultAutoArchiveDuration = data.default_auto_archive_duration; 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 * 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; this.autoArchiveDuration = data.thread_metadata.auto_archive_duration;
@@ -350,7 +350,7 @@ class ThreadChannel extends Channel {
* @returns {Promise<ThreadChannel>} * @returns {Promise<ThreadChannel>}
* @example * @example
* // Set the thread's auto archive time to 1 hour * // Set the thread's auto archive time to 1 hour
* thread.setAutoArchiveDuration(60) * thread.setAutoArchiveDuration(ThreadAutoArchiveDuration.OneHour)
* .then(newThread => { * .then(newThread => {
* console.log(`Thread will now archive after ${newThread.autoArchiveDuration} minutes of inactivity`); * console.log(`Thread will now archive after ${newThread.autoArchiveDuration} minutes of inactivity`);
* }); * });