Telegram bot powered by PraisonAI multi-agent framework
Project description
telegram-praisonai-bot
Telegram bot powered by PraisonAI multi-agent framework.
Installation
pip install telegram-praisonai-bot
Quick Start
-
Create a Telegram Bot
- Message @BotFather on Telegram
- Send
/newbotand follow the instructions - Copy the bot token
-
Start PraisonAI Server
pip install praisonai praisonai serve agents.yaml --port 8080
-
Run the Bot
export TELEGRAM_BOT_TOKEN=your_telegram_token export PRAISONAI_API_URL=http://localhost:8080 telegram-praisonai-bot
Or create a
.envfile:TELEGRAM_BOT_TOKEN=your_telegram_token PRAISONAI_API_URL=http://localhost:8080 PRAISONAI_TIMEOUT=300
Commands
| Command | Description |
|---|---|
/start |
Start the bot and show welcome message |
/help |
Show help message |
/ask <query> |
Ask PraisonAI agents a question |
/agent <name> <query> |
Ask a specific agent |
/agents |
List available PraisonAI agents |
You can also just send a message directly and the bot will process it.
Usage Examples
/ask What are the latest trends in AI?
/agent researcher Research quantum computing
/agents
Programmatic Usage
from telegram_praisonai_bot.bot import PraisonAITelegramBot
bot = PraisonAITelegramBot(
token="YOUR_TELEGRAM_TOKEN",
api_url="http://localhost:8080",
timeout=300
)
bot.run()
Using the Client Directly
import asyncio
from telegram_praisonai_bot import PraisonAIClient
async def main():
client = PraisonAIClient(api_url="http://localhost:8080")
# Run workflow
result = await client.run_workflow("Research AI trends")
print(result)
# Run specific agent
result = await client.run_agent("Write an article", "writer")
print(result)
# List agents
agents = await client.list_agents()
print(agents)
asyncio.run(main())
Configuration
| Environment Variable | Default | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN |
(required) | Telegram bot token from @BotFather |
PRAISONAI_API_URL |
http://localhost:8080 |
PraisonAI server URL |
PRAISONAI_TIMEOUT |
300 |
Request timeout in seconds |
Links
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 telegram_praisonai_bot-0.1.0.tar.gz.
File metadata
- Download URL: telegram_praisonai_bot-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65807c0ccd58f755f675c4f0acfec81c224840ade839448ea92f161d4f0a8942
|
|
| MD5 |
95ac11d49a0d30e70bc8d0505c577de2
|
|
| BLAKE2b-256 |
ce6f3ad3e2902929c66adea2af480d312c0219d46c5af4e00d4970c0335efd74
|
File details
Details for the file telegram_praisonai_bot-0.1.0-py3-none-any.whl.
File metadata
- Download URL: telegram_praisonai_bot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85328ef72222038296d6e7c1c9544fb1120d15a0078b91146ef9d33af1790d03
|
|
| MD5 |
bbc6735b60606e82e0c0efd7bd9dc573
|
|
| BLAKE2b-256 |
c5844d5664c3513dbe27af1dbf7395296a2904d9a15f5267a4c4a1c82f2a4c58
|