Skip to content

{{ community_contribution_banner }}

strands-telegram-listener is a real-time Telegram message processing tool with AI-powered auto-replies and comprehensive event handling.

Terminal window
pip install strands-telegram-listener
from strands import Agent
from strands_telegram_listener import telegram_listener
agent = Agent(tools=[telegram_listener])
# Start listening for messages
agent("start Telegram listener")
# Get recent messages
agent("get last 10 Telegram messages")
# Check listener status
agent("check Telegram listener status")
  • Real-time Processing: Long polling for instant message handling
  • AI Auto-replies: Intelligent responses using Strands agents
  • Event Storage: Comprehensive message history in JSONL format
  • Smart Filtering: Message deduplication and selective processing
  • Background Threading: Non-blocking operation
  • Status Monitoring: Real-time listener status and metrics
  • Flexible Configuration: Environment-based settings
Terminal window
TELEGRAM_BOT_TOKEN=your_bot_token # Required
STRANDS_TELEGRAM_AUTO_REPLY=true # Optional
STRANDS_TELEGRAM_LISTEN_ONLY_TAG=#support # Optional

Get your bot token at: BotFather