1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 20:30:58 -05:00

Stop the audit log flood

This commit is contained in:
toast-ts 2024-02-19 16:29:01 +11:00
parent 71b143d7da
commit 5a59e9cf75

View File

@ -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`);