Skip to main content

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 token
  • TELEGRAM_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 chat
  • TELEGRAM_WORLD_CONNECTED - Bot connected to existing chat
  • TELEGRAM_WORLD_LEFT - Bot left a chat
  • TELEGRAM_ENTITY_JOINED - User joined a chat
  • TELEGRAM_ENTITY_LEFT - User left a chat
  • TELEGRAM_ENTITY_UPDATED - User information updated
  • TELEGRAM_MESSAGE_RECEIVED - Message received
  • TELEGRAM_MESSAGE_SENT - Message sent
  • TELEGRAM_REACTION_RECEIVED - Reaction received
  • TELEGRAM_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elizaos_plugin_telegram-2.0.0a4.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elizaos_plugin_telegram-2.0.0a4-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file elizaos_plugin_telegram-2.0.0a4.tar.gz.

File metadata

File hashes

Hashes for elizaos_plugin_telegram-2.0.0a4.tar.gz
Algorithm Hash digest
SHA256 0b0a333c92d720082ad8b32636e1cc927a0a4dbc5b44993061d615d901a976d3
MD5 5ab40e6f2d2f9d8e71ae9bf63436cdbc
BLAKE2b-256 987766b24154775ae66bc94caa585387e106a1a74aafc47c316f73bbecb55f81

See more details on using hashes here.

File details

Details for the file elizaos_plugin_telegram-2.0.0a4-py3-none-any.whl.

File metadata

File hashes

Hashes for elizaos_plugin_telegram-2.0.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 a24cdbba64b09a9314383a651d56771ac33f4053a23f5977e1400c640aafc0e3
MD5 33a81035d3e7237afa311e128f2d87de
BLAKE2b-256 6aacdd0167e9cb9f6011fd339d7bafcbd6d51f9701126f6d3d127f98c03740f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page