diff --git a/main.js b/main.js index 341f8a4..9de62c6 100644 --- a/main.js +++ b/main.js @@ -51,15 +51,15 @@ async function main() { const users = response.data; 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 createdAt = new Date(user.createdAt); const updatedAt = new Date(user.updatedAt); const excludedUsers = ['instance.actor', 'relay.actor']; return user.notesCount === 0 && - createdAt < fiveDaysAgo && - updatedAt < fiveDaysAgo && + createdAt < timeAgo && + updatedAt < timeAgo && !excludedUsers.includes(user.username) });