Skip to content

Commit

Permalink
feat(ThreadManager): use defaultAutoArchiveDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ImRodry committed Oct 10, 2021
1 parent 1ba1c00 commit 8419783
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/managers/ThreadManager.js
Expand Up @@ -97,7 +97,14 @@ class ThreadManager extends CachedManager {
* .then(threadChannel => console.log(threadChannel))
* .catch(console.error);
*/
async create({ name, autoArchiveDuration, startMessage, type, invitable, reason } = {}) {
async create({
name,
autoArchiveDuration = this.channel.defaultAutoArchiveDuration,
startMessage,
type,
invitable,
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');
Expand Down
4 changes: 2 additions & 2 deletions src/structures/Message.js
Expand Up @@ -791,8 +791,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
*/

Expand Down

0 comments on commit 8419783

Please sign in to comment.