From 334848206178d340d69231e8fe7809b70264fbb5 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:29:01 +1100 Subject: [PATCH] Stop the audit log flood --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 8e5b341..d94cadd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,7 +31,7 @@ setInterval(async()=>{ for await (const thread of forum.threads.cache.values()) { await thread.messages.fetch(); - if (thread.lastMessage.createdTimestamp <= Date.now() - 1555200000) {// check if thread is inactive for over 18 days + if (!thread.archived && thread.lastMessage.createdTimestamp <= Date.now() - 1555200000) {// check if thread is inactive for over 18 days await thread.setLocked(true).catch(()=>null); await thread.setArchived(true, 'Inactive for over 18 days').catch(()=>null); Logger.console('log', 'ThreadTimer', `${thread.name} has been archived and locked due to inactivity`);