Add reset option to /incidents_diff

This commit is contained in:
2026-02-09 04:16:28 +03:00
parent fd179d24e8
commit 10bf265c29

View File

@@ -399,11 +399,19 @@ async def incidents_diff(msg: Message):
return
parts = msg.text.split()
hours = 24
reset = False
if len(parts) >= 2:
try:
hours = max(1, int(parts[1]))
except ValueError:
hours = 24
if parts[1].lower() in {"reset", "clear"}:
reset = True
else:
try:
hours = max(1, int(parts[1]))
except ValueError:
hours = 24
if reset:
runtime_state.set_state("incidents_diff_last_ts", None)
await msg.answer("📣 Diff marker reset. Next run will show all within window.", reply_markup=system_logs_audit_kb)
return
last_iso = runtime_state.get("incidents_diff_last_ts")
last_dt = None
if isinstance(last_iso, str):