Skip to content

Conversation

@sohw400
Copy link

@sohw400 sohw400 commented Oct 13, 2025

Overview

Adds Telegram bot integration to the social agent, checking off the "Telegram is coming soon" item from the README.

Implementation

The Telegram tool follows the same pattern as the existing Discord and Twitter integrations:

  • Async message handling using python-telegram-bot v22.5
  • Responds to all private chat messages
  • Responds to mentions in group chats
  • Uses the same LLM model interface as other tools
  • Includes configuration module for customization

Files Added

src/agent/agent_tools/telegram/
├── __init__.py
├── __main__.py          # Standalone test runner
├── telegram.py          # Main bot class
├── telegram_config.py   # Configuration
└── README.md            # Setup guide

Setup

  1. Get bot token from @Botfather on Telegram
  2. Add TELEGRAM_BOT_TOKEN to .env
  3. Set TELEGRAM_ENABLED = True in agent_config.py

Testing

Can be tested independently:

python3 -m src.agent.agent_tools.telegram

Notes

  • Bot automatically discovers and loads via the existing tool loader
  • Private chats: responds to all messages
  • Group chats: responds when mentioned
  • Error handling includes logging for debugging

Implemented Telegram bot integration following the existing tool pattern.
The bot responds to private messages and group mentions using the configured LLM.

Changes:
- Added telegram tool module with async message handling
- Supports private chats and group mentions
- Follows same architecture as Discord/Twitter tools
- Added python-telegram-bot v22.5 dependency
- Includes setup documentation and test script

Closes the "Telegram is coming soon" todo from README.
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