Skip to content

feat: make Telegram adapter optional#5

Open
roger704 wants to merge 1 commit intocoleam00:mainfrom
roger704:feature/telegram-optional
Open

feat: make Telegram adapter optional#5
roger704 wants to merge 1 commit intocoleam00:mainfrom
roger704:feature/telegram-optional

Conversation

@roger704
Copy link

Summary

Makes the Telegram adapter optional, allowing deployments that only use GitHub webhooks.

Changes:

  • Remove TELEGRAM_BOT_TOKEN from required environment variables
  • Make Telegram adapter initialization conditional (mirroring GitHub pattern)
  • Validate at least one platform adapter is configured
  • Update startup messages to reflect which adapters are active
  • Handle graceful shutdown when Telegram is disabled

Motivation

When using this project for GitHub-only deployments (via webhooks), the current code requires TELEGRAM_BOT_TOKEN to be set, causing startup failures. This change allows:

# GitHub-only deployment
GITHUB_TOKEN=xxx WEBHOOK_SECRET=xxx npm start

# Telegram-only deployment  
TELEGRAM_BOT_TOKEN=xxx npm start

# Both platforms
GITHUB_TOKEN=xxx WEBHOOK_SECRET=xxx TELEGRAM_BOT_TOKEN=xxx npm start

Test plan

  • Verify app starts with only GITHUB_TOKEN + WEBHOOK_SECRET
  • Verify app starts with only TELEGRAM_BOT_TOKEN
  • Verify app fails gracefully when no adapters configured
  • Verify graceful shutdown works with Telegram disabled

🤖 Generated with Claude Code

Previously, the application required TELEGRAM_BOT_TOKEN to be set,
even when only using GitHub webhooks. This change:

- Removes TELEGRAM_BOT_TOKEN from required environment variables
- Makes Telegram adapter initialization conditional (like GitHub)
- Validates that at least one platform adapter is configured
- Updates startup messages to reflect active adapters
- Properly handles graceful shutdown when Telegram is disabled

This allows deployments that only use GitHub webhooks without
needing Telegram credentials.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant