Component Libraries •
Project Templates
Docs •
Install •
Tutorials •
Developer Guides •
Contribute •
Blog •
Discord
Xircuits Component Library to interface with Telegram! Create Telegram Bots in minutes.
Uses python-telegram-bot as backend.
This library enables Xircuits to integrate with Telegram, allowing seamless interaction with Telegram bots. It simplifies bot initialization, message handling, and various types of media sharing.
Screencast_20250207_113522.mp4
Before you begin, you will need:
- Python 3.9+
- Xircuits
- A Telegram Bot Token
We have provided an example workflow to help you get started with the Telegram component library. Give it a try and see how you can create custom Telegram components for your applications.
Simple bot that echoes back any message it receives - perfect for understanding the basic bot setup.
Demonstrates how to use Xircuits events to create custom message handling and responses.
Shows how to implement command-based interactions (e.g., /start
, /help
) with argument parsing.
Showcases how to send various media types (images, PDFs, audio, video) in response to messages.
- Enhanced group chat support (currently optimized for 1-1 chats)
- Media reception capabilities (currently supports sending media only)
- Other cool stuff
- Start a chat with @BotFather on Telegram
- Use the
/newbot
command - Follow the prompts to:
- Set a name for your bot
- Choose a username (must end in 'bot')
- BotFather will provide a token - save this securely
- Keep this token secure - anyone with the token can control your bot
- export this token or create a .env file with TELEGRAM_BOT_KEY=YOUR_TOKEN.
- Bot usernames must end in 'bot' (e.g., 'tetris_bot' or 'TetrisBot')
- Usernames are 5-32 characters long
- Only Latin characters, numbers, and underscores are allowed
- Username cannot be changed after creation
To use this component library, ensure you have an existing Xircuits setup. You can then install this library using:
xircuits install telegram
Or manually:
# in base Xircuits directory
git clone https://github.com/XpressAI/xai-telegram xai_components/xai_telegram
pip install -r xai_components/xai_telegram/requirements.txt