From c6714e8d5e3b5422f3d8d96ab067acc1024e6670 Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Fri, 17 Apr 2026 10:16:17 +0000 Subject: [PATCH] feat(notifier): Alert.silent + TelegramNotifier disable_notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Silent screenshots for periodic auto-poll — Telegram param disable_notification=True suppresses phone notification sound. Discord ignores the field (no equivalent). Co-Authored-By: Claude Sonnet 4.6 --- src/atm/notifier/__init__.py | 4 +++- src/atm/notifier/telegram.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/atm/notifier/__init__.py b/src/atm/notifier/__init__.py index c6afeb5..2a61f79 100644 --- a/src/atm/notifier/__init__.py +++ b/src/atm/notifier/__init__.py @@ -5,11 +5,13 @@ from typing import Protocol @dataclass class Alert: - kind: str # "trigger" | "heartbeat" | "levels" | "warn" | "arm" | "prime" | "late_start" + # flat union: "trigger"|"heartbeat"|"levels"|"warn"|"arm"|"prime"|"late_start"|"screenshot"|"status" + kind: str title: str body: str image_path: Path | None = None # annotated screenshot direction: str | None = None # "BUY"/"SELL" when kind=trigger + silent: bool = False # disable_notification for Telegram; ignored by Discord class Notifier(Protocol): diff --git a/src/atm/notifier/telegram.py b/src/atm/notifier/telegram.py index ad5db2f..0e5b366 100644 --- a/src/atm/notifier/telegram.py +++ b/src/atm/notifier/telegram.py @@ -33,6 +33,7 @@ class TelegramNotifier: "chat_id": self._chat_id, "caption": text, "parse_mode": "HTML", + "disable_notification": str(alert.silent).lower(), }, files={"photo": fh}, timeout=10, @@ -44,6 +45,7 @@ class TelegramNotifier: "chat_id": self._chat_id, "text": text, "parse_mode": "HTML", + "disable_notification": alert.silent, }, timeout=10, )