scrubber/conf_pain.py

18 lines
525 B
Python
Raw Permalink Normal View History

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