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

Stop the audit log flood

This commit is contained in:
toast-ts 2024-02-19 16:29:01 +11:00
parent 6dc4b278a8
commit 3348482061

View File

@ -31,7 +31,7 @@ setInterval(async()=>{
for await (const thread of forum.threads.cache.values()) { for await (const thread of forum.threads.cache.values()) {
await thread.messages.fetch(); 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.setLocked(true).catch(()=>null);
await thread.setArchived(true, 'Inactive for over 18 days').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`); Logger.console('log', 'ThreadTimer', `${thread.name} has been archived and locked due to inactivity`);