feat(notifier): Alert.silent + TelegramNotifier disable_notification

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 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-17 10:16:17 +00:00
parent 238243b1ce
commit c6714e8d5e
2 changed files with 5 additions and 1 deletions

View File

@@ -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):

View File

@@ -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,
)