from __future__ import annotations import re def is_ms_timestamp(ts: int) -> bool: # Accept any positive-ish ms timestamp; avoid strict "current time" checks. return isinstance(ts, int) and ts > 0 def safe_sender(sender: str) -> str: s = sender.strip().lower() if s not in {"scammer", "user"}: raise ValueError("invalid sender") return s HOSTILE_RE = re.compile(r"\b(idiot|stupid|moron|abuse|wasting time|last warning|final warning)\b", re.I) def seems_hostile(text: str) -> bool: return bool(HOSTILE_RE.search(text or ""))