-
-
Notifications
You must be signed in to change notification settings - Fork 53
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Doesn't respect channel's default archive duration #115
Comments
Actually I will re-open this and do some experimenting. It could be that Discord says the default auto-archive duration is I know for a fact that this is un-synced with Discord's UI from a previous bug so up until this point I have just assumed all of it is Discord's fault, but I should double check that we're not contributing to the problem here. I don't want to rely on how things look in the UI vs what the value we are actually getting is, but we might have to do it anyways. It's a known bug, but thank you for pointing this out specifically which made me think about it some more:
|
This is the function that calculates the final auto-archive duration: export function getSafeDefaultAutoArchiveDuration(channel: TextChannel | NewsChannel): ThreadAutoArchiveDuration {
const archiveDuration = channel.defaultAutoArchiveDuration;
if (!archiveDuration || archiveDuration === "MAX") return "MAX";
const highest = getHighestAllowedArchiveDuration(channel);
return archiveDuration > highest
? highest
: archiveDuration;
} The only time this would make the auto-archive delay higher is if To clarify: I haven't even tested if it's the falsy case that trips us up here or if it's completely on Discord. |
Hi, thanks for pointing to the FAQ. When I followed the steps there I "fixed" my issue. Didn't know that the wiki existed 馃槵 I can also try on my end the API with newly created channels and check what one gets for the auto-archive duration. The code snippet you gave makes sense, I'd probably also have written it this way 馃槃 It would be unfortunate if Discord's API doesn't give back the value that is the default as an actual value. |
While looking at https://discord.com/developers/docs/resources/channel#get-channel I found:
And also: discordjs/discord.js#7687 + discordjs/discord.js#7688
|
Ok, so I've created my own bot for testing purposes and I logged out https://discord.js.org/#/docs/discord.js/stable/class/BaseGuildTextChannel via slash command. On a newly created channel the response doesn't contain |
As in, it's null/undefined? That would explain it then. |
Yes, It鈥檚 |
Describe the bug
Hi!
Thanks for creating and hosting the bot, I really appreciate it!
I'm currently using the hosted version and the server I've added it to has the maximum boost level, so one can set the archive duration to 1 week.
In #34 I saw:
I understand the reasoning for this at that time but I think it's a bug that the default duration that is selected for the channel is not evaluated first before falling back to the actual allowed value.
So I'm talking about this channel setting at the bottom:
Right now Needle sets every thread to 1 week which is too long, I want to have it at 24 hours.
Steps to reproduce the bug
Expected behavior
I expect the following:
The text was updated successfully, but these errors were encountered: