Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Threads): max autoArchiveDuration option #6304

Merged
merged 7 commits into from Aug 7, 2021
Merged

feat(Threads): max autoArchiveDuration option #6304

merged 7 commits into from Aug 7, 2021

Conversation

papsavas
Copy link
Contributor

@papsavas papsavas commented Aug 5, 2021

Please describe the changes this PR makes and why it should be merged:
This adds a "MAX" option to ThreadAutoArchiveDuration that sets a thread's auto-archive duration to the maximum one, based on the guilds boost count.

I understand that this is not really needed, so here's a couple of reasons this may or should get rejected:

  • Runtime check
  • Changes ThreadAutoArchiveDuration type to number | string (could be solved by setting all options to string and converting later)
  • Can be defined from moderators using channel default archived duration

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

src/managers/ThreadManager.js Outdated Show resolved Hide resolved
src/managers/ThreadManager.js Outdated Show resolved Hide resolved
src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
src/structures/Message.js Outdated Show resolved Hide resolved
src/managers/ThreadManager.js Outdated Show resolved Hide resolved
@iCrawl iCrawl added this to the Version 13 milestone Aug 5, 2021
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can make a new method in Util to fetch the highest duration available for a guild, but otherwise this is fine.

src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really love to see this filtering get moved to a util function, but LGTM I suppose

@iCrawl iCrawl modified the milestones: Version 13, Version 13.1 Aug 6, 2021
@iCrawl iCrawl merged commit 394d486 into discordjs:main Aug 7, 2021
@papsavas papsavas deleted the thread-max-archive-duration branch August 7, 2021 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants