Skip to main content

Discord bot powered by PraisonAI multi-agent framework

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discord_praisonai_bot-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discord_praisonai_bot-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file discord_praisonai_bot-0.1.0.tar.gz.

File metadata

  • Download URL: discord_praisonai_bot-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for discord_praisonai_bot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4aefc3326f7d5c678c9641c6cf6f23cf2e9594178a8862c9a2081441672ac24a
MD5 529a1a0a56dff21eb5bc4ffdefff5b79
BLAKE2b-256 24a76bf2f75a64537fab3f5595a9bed09c432b63543cf8a6484b8dbe06b89878

See more details on using hashes here.

File details

Details for the file discord_praisonai_bot-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for discord_praisonai_bot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1cb2bb0fbd855cba075023ddbaa4e8ceaf25253239913044c7b742b17d27c7e
MD5 4c83577f28a5ce8fcf2596cbd49df99b
BLAKE2b-256 f68b50ceaefbd046e89d221a2ab5fd5e14f419d73e290ee14c322cb6f323cc3a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page