mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-18 00:31:00 -05:00
Stop the audit log flood
This commit is contained in:
parent
71b143d7da
commit
5a59e9cf75
@ -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`);
|
||||||
|
Loading…
Reference in New Issue
Block a user