Skip to content

feat: Telegram Core API Integration - Webhook, Bot, Chat, Rate Limiting#603

Open
zp6 wants to merge 1 commit into
Spectral-Finance:mainfrom
zp6:feature/telegram-core-api-62
Open

feat: Telegram Core API Integration - Webhook, Bot, Chat, Rate Limiting#603
zp6 wants to merge 1 commit into
Spectral-Finance:mainfrom
zp6:feature/telegram-core-api-62

Conversation

@zp6
Copy link
Copy Markdown

@zp6 zp6 commented May 15, 2026

Telegram Core API Integration (Closes #62)

Implements comprehensive Telegram Bot API integration covering webhook management, bot lifecycle, chat operations, rate limiting, and error handling.

Webhook Management

  • SetWebhookPrism - Configure webhook URL with secret token verification, allowed updates filtering, max connections, and IP address pinning
  • GetWebhookInfoPrism - Monitor webhook health, pending update count, last error diagnostics
  • DeleteWebhookPrism - Remove webhook and switch to getUpdates polling mode

Bot Management

  • GetBotInfoPrism - Bot identity verification via getMe, capabilities check
  • GetUpdatesPrism - Long polling with offset tracking, timeout config, update type filtering

Chat Operations

  • GetChatPrism - Chat metadata, member counts, pinned messages, photo info
  • LeaveChatPrism - Leave groups, supergroups, or channels
  • GetChatMemberCountPrism - Real-time member count tracking

Infrastructure

  • RateLimiter (GenServer + ETS) - Sliding window rate limiting per chat type (global 30/s, group 20/min, private 1/s, channel 30/s) with automatic cleanup
  • ErrorHandler - Exponential backoff with jitter, error classification (transient/fatal/rate_limited/conflict), max retry control, retry callbacks

Acceptance Criteria

  • Bot authentication and info retrieval
  • Webhook integration (set/get/delete)
  • Rate limiting with per-chat-type limits
  • Error handling with exponential backoff and retries
  • Chat management operations

…ng, Error Handling (Spectral-Finance#62)

Implements comprehensive Telegram Bot API integration:

### Webhook Management
- SetWebhookPrism: configure webhook URL with secret token, allowed updates
- GetWebhookInfoPrism: webhook status monitoring, error diagnostics
- DeleteWebhookPrism: remove webhook, switch to polling mode

### Bot Management
- GetBotInfoPrism: bot identity verification (getMe)
- GetUpdatesPrism: long polling with offset tracking and filtering

### Chat Operations
- GetChatPrism: chat metadata, member counts, pinned messages
- LeaveChatPrism: leave groups/channels
- GetChatMemberCountPrism: member count tracking

### Infrastructure
- RateLimiter: ETS-based sliding window rate limiting per chat type
- ErrorHandler: exponential backoff with jitter, error classification

Closes Spectral-Finance#62
@zp6 zp6 mentioned this pull request May 15, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram Core API Integration ($2,500)

1 participant