Skip to content

Commit

Permalink
types(StartThreadOptions): mark autoArchiveDuration as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ImRodry committed Oct 10, 2021
1 parent bfb89de commit 1ba1c00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
11 changes: 0 additions & 11 deletions src/managers/ThreadManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ class ThreadManager extends CachedManager {
* @returns {?Snowflake}
*/

/**
* A number that is allowed to be the duration (in minutes) of inactivity after which a thread is automatically
* archived. This can be:
* * `60` (1 hour)
* * `1440` (1 day)
* * `4320` (3 days) <warn>This is only available when the guild has the `THREE_DAY_THREAD_ARCHIVE` feature.</warn>
* * `10080` (7 days) <warn>This is only available when the guild has the `SEVEN_DAY_THREAD_ARCHIVE` feature.</warn>
* * `'MAX'` Based on the guild's features
* @typedef {number|string} ThreadAutoArchiveDuration
*/

/**
* Options for creating a thread. <warn>Only one of `startMessage` or `type` can be defined.</warn>
* @typedef {StartThreadOptions} ThreadCreateOptions
Expand Down
13 changes: 12 additions & 1 deletion src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,11 +776,22 @@ class Message extends Base {
return this.channel.send(data);
}

/**
* A number that is allowed to be the duration (in minutes) of inactivity after which a thread is automatically
* archived. This can be:
* * `60` (1 hour)
* * `1440` (1 day)
* * `4320` (3 days) <warn>This is only available when the guild has the `THREE_DAY_THREAD_ARCHIVE` feature.</warn>
* * `10080` (7 days) <warn>This is only available when the guild has the `SEVEN_DAY_THREAD_ARCHIVE` feature.</warn>
* * `'MAX'` Based on the guild's features
* @typedef {number|string} ThreadAutoArchiveDuration
*/

/**
* 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
* @property {ThreadAutoArchiveDuration} [autoArchiveDuration] 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
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4835,7 +4835,7 @@ export type StageInstanceResolvable = StageInstance | Snowflake;

export interface StartThreadOptions {
name: string;
autoArchiveDuration: ThreadAutoArchiveDuration;
autoArchiveDuration?: ThreadAutoArchiveDuration;
reason?: string;
}

Expand Down

0 comments on commit 1ba1c00

Please sign in to comment.