You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating (editing) a thread, the autoArchiveDuration field of StartThreadOptions (ThreadEditData) should accept 60 | 1440 | 4320 | 10080 | 'MAX' according to the current documentation. However, the current type of the field (ThreadAutoArchiveDuration) only expands to 60 | 1440 | 4320 | 10080. 'MAX' is missing. It should be added to the fields as a separate type, not to ThreadAutoArchiveDuration. The 'MAX' option in the current documentation should be moved from ThreadAutoArchiveDuration to the individual fields.
Additionally, Util.resolveAutoArchiveMaxLimit currently has a return type of number, which prevents it from being assigned to ThreadAutoArchiveDuration unless you do unnecessary type checks. The return type should be changed to ThreadAutoArchiveDuration.
If you decide to leave the typings as they are in the current documentation (i.e. include 'MAX' in ThreadAutoArchiveDuration), then you should add a separate type for Util.resolveAutoArchiveMaxLimit which doesn't include 'MAX'.
Getting this problem in 13.7.0, the "MAX" option has disappeared.
But it still exists in the docs for 13.7.0:
Is the plan to release this fix for 14.0.0? Should the docs be updated for this version?
Edit: I slightly misunderstood the issue. I understand now that "MAX" should not be added to ThreadAutoArchiveDuration, but it would still be good if the docs confirmed that.
Edit: I slightly misunderstood the issue. I understand now that "MAX" should not be added to ThreadAutoArchiveDuration, but it would still be good if the docs confirmed that.
There is no point - the MAX option will disappear in the next major version as its use is obsolete.
Which package is this bug report for?
discord.js
Issue description
When creating (editing) a thread, the
autoArchiveDuration
field ofStartThreadOptions
(ThreadEditData
) should accept60 | 1440 | 4320 | 10080 | 'MAX'
according to the current documentation. However, the current type of the field (ThreadAutoArchiveDuration
) only expands to60 | 1440 | 4320 | 10080
.'MAX'
is missing. It should be added to the fields as a separate type, not toThreadAutoArchiveDuration
. The'MAX'
option in the current documentation should be moved fromThreadAutoArchiveDuration
to the individual fields.Additionally,
Util.resolveAutoArchiveMaxLimit
currently has a return type ofnumber
, which prevents it from being assigned toThreadAutoArchiveDuration
unless you do unnecessary type checks. The return type should be changed toThreadAutoArchiveDuration
.If you decide to leave the typings as they are in the current documentation (i.e. include
'MAX'
inThreadAutoArchiveDuration
), then you should add a separate type forUtil.resolveAutoArchiveMaxLimit
which doesn't include'MAX'
.Code sample
No response
Package version
discord.js@14.0.0-dev.1650240532-9ef7ffd
Node.js version
v17.9.0 (typescript@4.6.3)
Operating system
No response
Priority this issue should have
Medium (should be fixed soon)
Which partials do you have configured?
Not applicable (subpackage bug)
Which gateway intents are you subscribing to?
Not applicable (subpackage bug)
I have tested this issue on a development release
9ef7ffd
The text was updated successfully, but these errors were encountered: