Update main.js

This commit is contained in:
PawzyTheJawzy 2025-01-09 02:11:27 +01:00
parent 156e2ec79e
commit dca5f2e31a

View file

@ -51,15 +51,15 @@ async function main() {
const users = response.data; const users = response.data;
const now = new Date(); const now = new Date();
const TimeAgo = new Date(now - PERIOD * 24 * 60 * 60 * 1000); const timeAgo = new Date(now - PERIOD * 24 * 60 * 60 * 1000);
const usersToDelete = users.filter(user => { const usersToDelete = users.filter(user => {
const createdAt = new Date(user.createdAt); const createdAt = new Date(user.createdAt);
const updatedAt = new Date(user.updatedAt); const updatedAt = new Date(user.updatedAt);
const excludedUsers = ['instance.actor', 'relay.actor']; const excludedUsers = ['instance.actor', 'relay.actor'];
return user.notesCount === 0 && return user.notesCount === 0 &&
createdAt < fiveDaysAgo && createdAt < timeAgo &&
updatedAt < fiveDaysAgo && updatedAt < timeAgo &&
!excludedUsers.includes(user.username) !excludedUsers.includes(user.username)
}); });