scrubber/conf_pain.py
2024-10-04 15:43:40 -07:00

17 lines
525 B
Python

import math
from datetime import UTC, datetime, timedelta
from com import FilterableNote, FilterAction
from sec import connect, tokens
user_id = "9gszslkcdfnomssj"
token = tokens["pain"]
api = "https://void.rehab/api"
def criteria(root: FilterableNote) -> (bool, FilterAction):
# if it's more than two months old, delete
latest = max(map(lambda note: note.when, root.thread_self()))
if (datetime.now(UTC) - latest).days > 60:
return FilterAction.Obliterate
else:
return FilterAction.Ignore