strands-telegram-listener
Section titled “strands-telegram-listener”{{ community_contribution_banner }}
strands-telegram-listener is a real-time Telegram message processing tool with AI-powered auto-replies and comprehensive event handling.
Installation
Section titled “Installation”pip install strands-telegram-listenerfrom strands import Agentfrom strands_telegram_listener import telegram_listener
agent = Agent(tools=[telegram_listener])
# Start listening for messagesagent("start Telegram listener")
# Get recent messagesagent("get last 10 Telegram messages")
# Check listener statusagent("check Telegram listener status")Key Features
Section titled “Key Features”- 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
Configuration
Section titled “Configuration”TELEGRAM_BOT_TOKEN=your_bot_token # RequiredSTRANDS_TELEGRAM_AUTO_REPLY=true # OptionalSTRANDS_TELEGRAM_LISTEN_ONLY_TAG=#support # OptionalGet your bot token at: BotFather