Getting Started

Prerequisites

  • Python 3.13 or higher

  • uv package manager (recommended) or pip

  • A Discord bot token

  • Discord server with appropriate permissions

Installation

  1. Clone the Repository

    git clone https://github.com/krazyito65/python-wa-discord-bot.git
    cd python-wa-discord-bot
    
  2. Install Dependencies

    Using uv (recommended):

    uv sync
    

    Or using pip:

    pip install -r requirements.txt
    
  3. Create Configuration File

    cp settings/token.yml.example settings/token.yml
    

Configuration

Edit settings/token.yml with your Discord bot tokens:

discord:
  tokens:
    dev: "your_dev_token_here"
    prod: "your_prod_token_here"
bot:
  admin_role: "admin"
storage:
  data_directory: "server_data"

Discord Bot Setup

  1. Create a Discord Application

  2. Create a Bot User

    • In your application, go to the “Bot” section

    • Click “Add Bot”

    • Copy the token to your settings/token.yml file

  3. Set Bot Permissions

    Required permissions: * Use Slash Commands * Send Messages * Embed Links * Read Message History

  4. Invite Bot to Server

    • Go to the “OAuth2” > “URL Generator” section

    • Select “bot” and “applications.commands” scopes

    • Select the required permissions

    • Use the generated URL to invite the bot

Running the Bot

Development mode (default):

uv run python main.py

Production mode:

uv run python main.py --env prod

Custom configuration file:

uv run python main.py --config my_config.yml

First Steps

Once the bot is running and in your server:

  1. Test the Bot

    /ping
    
  2. Create Your First Macro

    /create_macro welcome "Welcome to our WeakAuras community!"
    
  3. Use the Macro

    /macro welcome
    
  4. List All Macros

    /list_macros
    

Troubleshooting

Bot doesn’t respond to commands:
  • Make sure the bot has “Use Slash Commands” permission

  • Check that commands are synced (should happen automatically on startup)

“No token found” error:
  • Verify your settings/token.yml file exists and has valid tokens

  • Check that the token matches the environment you’re running

Permission errors:
  • Ensure the bot has necessary permissions in your Discord server

  • Check that admin roles are properly configured for management commands