Automatically revive archived threads

Hello, I'm trying to do a simple thing. When a forum post gets archived, then automatically unarchive it.
client.on("threadUpdate", async (thread, oldThread) => {
    if (thread.archived && !oldThread.archived) {
        await thread.setArchived(false);
    }
});

However, when testing i'm right clicking the post and then doing the "Close post" action, which doesn't get picked up by the bot. Is threadUpdate the right event to use?
Was this page helpful?