# Telegram Alert Setup

CryptoTradingBot alert delivery reads Telegram credentials from environment variables or this secret file:

```text
~/.hermes/secrets/crypto_agent_telegram.env
```

Required content:

```dotenv
CTB_TELEGRAM_ALERTS=true
CTB_TELEGRAM_BOT_TOKEN=<telegram-bot-token>
CTB_TELEGRAM_CHAT_ID=<target-chat-id>
CTB_TELEGRAM_THREAD_ID=6579
CTB_TELEGRAM_TIMEOUT=10
```

Notes:

- Do not commit this file.
- The bot requires a forum topic thread ID; current command topic is `6579`.
- Run smoke:

```bash
python3 -m src.tools.telegram_alert_smoke --json
python3 -m src.tools.tradingview_alert_proof --runtime-dir runtime --json
python3 -m src.tools.tradingview_operational_gates --runtime-dir runtime --json
```

Operational Gates can only reach 5/5 after a real, non-dry-run alert smoke returns `status=ok` and all planned alerts have `sent=true`.
