From 672032b93f4ddfc25c04a6f5b1f07b232d22cea0 Mon Sep 17 00:00:00 2001 From: Rodry <38259440+ImRodry@users.noreply.github.com> Date: Wed, 4 Aug 2021 18:40:41 +0100 Subject: [PATCH] feat(ThreadManager): use defaultAutoArchiveDuration --- src/managers/ThreadManager.js | 8 +++++++- src/structures/Message.js | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/managers/ThreadManager.js b/src/managers/ThreadManager.js index 05ca834727ee..1b3bfc295f1f 100644 --- a/src/managers/ThreadManager.js +++ b/src/managers/ThreadManager.js @@ -95,7 +95,13 @@ class ThreadManager extends CachedManager { * .then(threadChannel => console.log(threadChannel)) * .catch(console.error); */ - async create({ name, autoArchiveDuration, startMessage, type, reason } = {}) { + async create({ + name, + autoArchiveDuration = this.channel.defaultAutoArchiveDuration, + startMessage, + type, + reason, + } = {}) { let path = this.client.api.channels(this.channel.id); if (type && typeof type !== 'string' && typeof type !== 'number') { throw new TypeError('INVALID_TYPE', 'type', 'ThreadChannelType or Number'); diff --git a/src/structures/Message.js b/src/structures/Message.js index bb1bd8d92bc4..3f949eee91ac 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -765,8 +765,8 @@ class Message extends Base { * Options for starting a thread on a message. * @typedef {Object} StartThreadOptions * @property {string} name The name of the new thread - * @property {ThreadAutoArchiveDuration} [autoArchiveDuration] The amount of time (in minutes) after which the thread - * should automatically archive in case of no recent activity + * @property {ThreadAutoArchiveDuration} [autoArchiveDuration=this.channel.defaultAutoArchiveDuration] The amount of + * time (in minutes) after which the thread should automatically archive in case of no recent activity * @property {string} [reason] Reason for creating the thread */