Skip to main content

discord-praisonai-bot

Discord bot powered by PraisonAI multi-agent framework.

Installation

pip install discord-praisonai-bot

Quick Start

  1. Create a Discord Bot

    • Go to Discord Developer Portal
    • Create a new application
    • Go to Bot → Add Bot
    • Copy the token
    • Enable "Message Content Intent" under Privileged Gateway Intents
  2. Invite Bot to Server

    • Go to OAuth2 → URL Generator
    • Select scopes: bot, applications.commands
    • Select permissions: Send Messages, Use Slash Commands
    • Copy and open the generated URL
  3. Start PraisonAI Server

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

    export DISCORD_TOKEN=your_discord_token
    export PRAISONAI_API_URL=http://localhost:8080
    discord-praisonai-bot
    

    Or create a .env file:

    DISCORD_TOKEN=your_discord_token
    PRAISONAI_API_URL=http://localhost:8080
    PRAISONAI_TIMEOUT=300
    

Commands

Command Description
/ask <query> Ask PraisonAI agents a question
/ask <query> <agent> Ask a specific agent (e.g., researcher)
/agents List available PraisonAI agents
/praisonai Show bot information

Usage Examples

/ask What are the latest trends in AI?
/ask Research quantum computing researcher
/agents

Programmatic Usage

from discord_praisonai_bot import PraisonAIBot

bot = PraisonAIBot(
    token="YOUR_DISCORD_TOKEN",
    api_url="http://localhost:8080",
    timeout=300
)
bot.run_bot()

Using the Client Directly

import asyncio
from discord_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
DISCORD_TOKEN (required) Discord bot token
PRAISONAI_API_URL http://localhost:8080 PraisonAI server URL
PRAISONAI_TIMEOUT 300 Request timeout in seconds

Links

License

MIT

Metadata

Release files for discord-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 discord-praisonai-bot 0.1.0
File Size Uploaded
discord_praisonai_bot-0.1.0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for discord-praisonai-bot 0.1.0
File Interpreter ABI Platform
discord_praisonai_bot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / discord_praisonai_bot-0.1.0.tar.gz

Download URL discord_praisonai_bot-0.1.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4aefc3326f7d5c678c9641c6cf6f23cf2e9594178a8862c9a2081441672ac24a
BLAKE2b-256 checksum
How to use checksums
24a76bf2f75a64537fab3f5595a9bed09c432b63543cf8a6484b8dbe06b89878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / discord_praisonai_bot-0.1.0-py3-none-any.whl

Download URL discord_praisonai_bot-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1cb2bb0fbd855cba075023ddbaa4e8ceaf25253239913044c7b742b17d27c7e
BLAKE2b-256 checksum
How to use checksums
f68b50ceaefbd046e89d221a2ab5fd5e14f419d73e290ee14c322cb6f323cc3a
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