Getting Started
Prerequisites
Python 3.13 or higher
uv package manager (recommended) or pip
A Discord bot token
Discord server with appropriate permissions
Installation
Clone the Repository
git clone https://github.com/krazyito65/python-wa-discord-bot.git cd python-wa-discord-bot
Install Dependencies
Using uv (recommended):
uv sync
Or using pip:
pip install -r requirements.txt
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
Create a Discord Application
Click “New Application”
Give your bot a name
Create a Bot User
In your application, go to the “Bot” section
Click “Add Bot”
Copy the token to your
settings/token.yml
file
Set Bot Permissions
Required permissions: * Use Slash Commands * Send Messages * Embed Links * Read Message History
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:
Test the Bot
/ping
Create Your First Macro
/create_macro welcome "Welcome to our WeakAuras community!"
Use the Macro
/macro welcome
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 tokensCheck 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