From 6dbc2afbf4c3bc0bed7d134a3726ab93d29ae8fe Mon Sep 17 00:00:00 2001 From: agentson Date: Wed, 4 Feb 2026 21:34:05 +0900 Subject: [PATCH] feat: add Telegram configuration to settings (issue #33) Add Telegram notification configuration: - src/config.py: Add TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, TELEGRAM_ENABLED - .env.example: Add Telegram section with setup instructions Fields added after S3_REGION (line 55). Follows existing optional API pattern (NEWS_API_KEY, etc.). No breaking changes to existing settings. Co-Authored-By: Claude Sonnet 4.5 --- .env.example | 7 +++++++ src/config.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/.env.example b/.env.example index 4142d5a..cc2ffb0 100644 --- a/.env.example +++ b/.env.example @@ -26,3 +26,10 @@ MODE=paper # NEWS_API_KEY=your_news_api_key_here # NEWS_API_PROVIDER=alphavantage # MARKET_DATA_API_KEY=your_market_data_key_here + +# Telegram Notifications (optional) +# Get bot token from @BotFather on Telegram +# Get chat ID from @userinfobot or your chat +# TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz +# TELEGRAM_CHAT_ID=123456789 +# TELEGRAM_ENABLED=true diff --git a/src/config.py b/src/config.py index cda4656..222afd0 100644 --- a/src/config.py +++ b/src/config.py @@ -54,6 +54,11 @@ class Settings(BaseSettings): S3_BUCKET_NAME: str | None = None S3_REGION: str = "us-east-1" + # Telegram Notifications (optional) + TELEGRAM_BOT_TOKEN: str | None = None + TELEGRAM_CHAT_ID: str | None = None + TELEGRAM_ENABLED: bool = True + model_config = {"env_file": ".env", "env_file_encoding": "utf-8"} @property