Skip to content

Native Telegram Integration #97

Description

@dzianisv

Summary

Integrate Telegram bot directly into opencode-manager so it starts automatically when TELEGRAM_BOT_TOKEN is configured.

Background

Currently, Telegram integration requires running external owpenbot (npm package owpenwork) separately.
The requirements.md states: 'When TELEGRAM_BOT_TOKEN is provided, Telegram MUST work'.

Proposed Solution

  1. Add native Telegram service using grammy library
  2. Auto-start when TELEGRAM_BOT_TOKEN env var is set
  3. Add database tables for sessions and allowlist
  4. Add Settings UI for Telegram configuration
  5. Add API routes for Telegram management

Acceptance Criteria

  • When TELEGRAM_BOT_TOKEN is set, Telegram bot starts automatically
  • Bot responds to messages via OpenCode
  • Session persistence per chat ID
  • Optional allowlist for access control
  • Settings UI to configure Telegram
  • Health endpoint shows Telegram status
  • Integration tests verify functionality

Technical Design

Based on owpenbot implementation:

  • Use grammy for Telegram API
  • Store sessions in SQLite
  • Connect to OpenCode via SDK
  • Chunk long messages (4096 char limit)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions