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
Metadata
Release files for telegram-praisonai-bot 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| telegram_praisonai_bot-0.1.0.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| telegram_praisonai_bot-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.3 kB
Release files / telegram_praisonai_bot-0.1.0.tar.gz
| Download URL | telegram_praisonai_bot-0.1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65807c0ccd58f755f675c4f0acfec81c224840ade839448ea92f161d4f0a8942
|
|
BLAKE2b-256 checksum How to use checksums |
ce6f3ad3e2902929c66adea2af480d312c0219d46c5af4e00d4970c0335efd74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Release files / telegram_praisonai_bot-0.1.0-py3-none-any.whl
| Download URL | telegram_praisonai_bot-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85328ef72222038296d6e7c1c9544fb1120d15a0078b91146ef9d33af1790d03
|
|
BLAKE2b-256 checksum How to use checksums |
c5844d5664c3513dbe27af1dbf7395296a2904d9a15f5267a4c4a1c82f2a4c58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|