mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23: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
|
* 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',
|
||||||
* })
|
* })
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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`);
|
||||||
* });
|
* });
|
||||||
|
|||||||
Reference in New Issue
Block a user