Skip to main content

telegram-praisonai-bot

Telegram bot powered by PraisonAI multi-agent framework.

Installation

pip install telegram-praisonai-bot

Quick Start

  1. Create a Telegram Bot

    • Message @BotFather on Telegram
    • Send /newbot and follow the instructions
    • Copy the bot token
  2. Start PraisonAI Server

    pip install praisonai
    praisonai serve agents.yaml --port 8080
    
  3. Run the Bot

    export TELEGRAM_BOT_TOKEN=your_telegram_token
    export PRAISONAI_API_URL=http://localhost:8080
    telegram-praisonai-bot
    

    Or create a .env file:

    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

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)

Source distribution for telegram-praisonai-bot 0.1.0
File Size Uploaded
telegram_praisonai_bot-0.1.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for telegram-praisonai-bot 0.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page