How terranc/claude-telegram-bot-bridge works
This is a Telegram bridge for remotely operating Claude Code in a chosen project. The main flow is a Telegram message handled by the bot, routed to a per-user Claude SDK session, and returned through progressive Telegram updates. Distinct branches cover voice input and output, session/history and revert controls, and access approval. The map includes documented capabilities whose implementation was not sampled; their relationships are shown only where README statements or excerpts support them.
Main entry points: bot.py Bot commands and routing · project_chat.py Project chat handler · transcription.py Speech transcription · manager.py Session manager
Components 16
Telegram interface
- Bot commands and routing
core/bot.py
Claude interaction
- Project chat handler
core/project_chat.py - Progressive updates
core/streaming.py
Voice processing
- Audio conversion
utils/audio_processor.py - Speech transcription
utils/transcription.py - Voice file upload
utils/tos_uploader.py - Voice reply synthesis
utils/tts.py
Sessions and operations
- Session manager
session/manager.py - JSON session store
session/store.py - Configuration
utils/config.py - Health monitoring
utils/health.py
Other components
- Telegram user
- Telegram
- Claude Code SDK
- OpenAI Whisper
- Volcengine ASR and TOS
Connections 16
- Telegram user → Telegram: sends messages
README.md - Telegram → Bot commands and routing: delivers updates
README.md - Bot commands and routing → Project chat handler: routes chat
core/bot.py - Project chat handler → Claude Code SDK: runs requests
README.md - Project chat handler → Progressive updates: updates drafts
core/project_chat.py - Progressive updates → Telegram: edits messages
core/streaming.py - Bot commands and routing → Session manager: reads session state
core/bot.py - Session manager → JSON session store: reads and writes
session/manager.py - Session manager → Configuration: reads timeout
session/manager.py - Bot commands and routing → Audio conversion: converts voice
README.md - Audio conversion → Speech transcription: prepares audio
README.md - Speech transcription → OpenAI Whisper: transcribes
README.md - Speech transcription → Volcengine ASR and TOS: optional ASR
- Bot commands and routing → Voice reply synthesis: synthesizes replies
README.md - Voice file upload → Volcengine ASR and TOS: uploads voice files
utils/tos_uploader.py - Bot commands and routing → Health monitoring: reports health