Implement TelegramClient core module #31

Closed
opened 2026-02-04 21:26:03 +09:00 by agentson · 0 comments
Collaborator

Goal

Create the core TelegramClient module for sending notifications to Telegram.

Scope

  • Create src/notifications/ package
  • Implement TelegramClient class in telegram_client.py
    • NotificationPriority enum (LOW/MEDIUM/HIGH/CRITICAL)
    • LeakyBucket rate limiter (1 msg/sec)
    • Async notification methods (trade, circuit breaker, fat finger, market open/close, system start/shutdown, errors)
    • Graceful degradation (optional API, never crashes)
  • Create src/notifications/__init__.py
  • Create src/notifications/README.md (setup guide, troubleshooting)

Implementation Notes

  • Follow NewsAPI pattern for optional APIs (src/data/news_api.py)
  • Use aiohttp for async HTTP (no new dependencies)
  • Session management pattern from KISBroker

Success Criteria

  • TelegramClient sends notifications successfully
  • Rate limiter prevents spam
  • Works with and without credentials (graceful degradation)

Part 1 of Telegram notification system implementation

## Goal Create the core TelegramClient module for sending notifications to Telegram. ## Scope - Create `src/notifications/` package - Implement `TelegramClient` class in `telegram_client.py` - NotificationPriority enum (LOW/MEDIUM/HIGH/CRITICAL) - LeakyBucket rate limiter (1 msg/sec) - Async notification methods (trade, circuit breaker, fat finger, market open/close, system start/shutdown, errors) - Graceful degradation (optional API, never crashes) - Create `src/notifications/__init__.py` - Create `src/notifications/README.md` (setup guide, troubleshooting) ## Implementation Notes - Follow NewsAPI pattern for optional APIs (src/data/news_api.py) - Use aiohttp for async HTTP (no new dependencies) - Session management pattern from KISBroker ## Success Criteria - TelegramClient sends notifications successfully - Rate limiter prevents spam - Works with and without credentials (graceful degradation) ## Related Part 1 of Telegram notification system implementation
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#31