#thread.archived returning incorrect boolean

10 messages · Page 1 of 1 (latest)

slender compass
#

I'm using the threadUpdate event to check when a forum post gets automatically archived. I then compare oldThread and newThread to check if it has gotten archived:

  name: "threadUpdate",
  async execute(oldThread, newThread) {
    if (oldThread.archived === newThread.archived) return;
    if (newThread.archived === true) {
      //do stuff
    }
  }
}```
Sometimes the bot just execute what's inside the if even if it's not archived, sometimes even after a new message in an active post.

How is that even possible? Is there something I'm missing?

node: v18.12.1
wise hound
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

slender compass
#

I found this. It's from a few months back and never got answered, so no idea if that was true or got fixed. Anyway, even in this case, newThread.archived shouldn't be true.

#1013235322856939592 message

maiden sand
#

So what you're saying is when a forum post gets archived, newThread#archived is false, when it should be true?

slender compass
#

No. The post is not archived, we are chatting, and newThread#archived looks to be true as the if gets executed.

maiden sand
#

It probably is archived

slender compass
#

How is that possible? Afaik discord only archives after inactivity. And there is no setArchived in the bot.

maiden sand
#

Dunno, but this is all the code we have of it. If it's changing, it's because Discord sent it

slender compass
#

😩 I hate discord

#

Will add a bunch of console.logs and check if I see something weird.