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