Telegram plugin for elizaOS - Python implementation for bot integration
Project description
elizaOS Telegram Plugin (Python)
Telegram bot integration for elizaOS agents.
Features
- Telegram bot message handling
- Support for private chats, groups, and supergroups
- Forum topic support for supergroups
- Entity synchronization
- Reaction handling
- Button support (login and URL buttons)
Installation
pip install elizaos-plugin-telegram
Configuration
The plugin requires the following environment variables:
TELEGRAM_BOT_TOKEN(required): Your Telegram Bot API tokenTELEGRAM_API_ROOT(optional): Custom API root URL (default:https://api.telegram.org)TELEGRAM_ALLOWED_CHATS(optional): JSON array of allowed chat IDs
Usage
from elizaos_plugin_telegram import TelegramService, TelegramConfig
# Create configuration
config = TelegramConfig.from_env()
# Initialize service
service = TelegramService(config)
# Start the bot
await service.start()
Event Types
The plugin emits the following event types:
TELEGRAM_WORLD_JOINED- Bot joined a new chatTELEGRAM_WORLD_CONNECTED- Bot connected to existing chatTELEGRAM_WORLD_LEFT- Bot left a chatTELEGRAM_ENTITY_JOINED- User joined a chatTELEGRAM_ENTITY_LEFT- User left a chatTELEGRAM_ENTITY_UPDATED- User information updatedTELEGRAM_MESSAGE_RECEIVED- Message receivedTELEGRAM_MESSAGE_SENT- Message sentTELEGRAM_REACTION_RECEIVED- Reaction receivedTELEGRAM_SLASH_START- /start command received
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Type checking
mypy elizaos_plugin_telegram
# Linting
ruff check elizaos_plugin_telegram
ruff format elizaos_plugin_telegram
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elizaos_plugin_telegram-2.0.0a4.tar.gz.
File metadata
- Download URL: elizaos_plugin_telegram-2.0.0a4.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b0a333c92d720082ad8b32636e1cc927a0a4dbc5b44993061d615d901a976d3
|
|
| MD5 |
5ab40e6f2d2f9d8e71ae9bf63436cdbc
|
|
| BLAKE2b-256 |
987766b24154775ae66bc94caa585387e106a1a74aafc47c316f73bbecb55f81
|
File details
Details for the file elizaos_plugin_telegram-2.0.0a4-py3-none-any.whl.
File metadata
- Download URL: elizaos_plugin_telegram-2.0.0a4-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a24cdbba64b09a9314383a651d56771ac33f4053a23f5977e1400c640aafc0e3
|
|
| MD5 |
33a81035d3e7237afa311e128f2d87de
|
|
| BLAKE2b-256 |
6aacdd0167e9cb9f6011fd339d7bafcbd6d51f9701126f6d3d127f98c03740f6
|