Skip to main content

Quick Start Guide

Get your pwr-bot instance up and running quickly using Docker Compose. This is the fastest and recommended method for deployment.

Prerequisites

Before you begin, ensure you have:
  • Docker installed
  • A Discord account with permissions to create applications
  • Basic knowledge of command-line operations
If you prefer to run without Docker, see the Manual Installation guide.

Step 1: Discord Application Setup

First, create a Discord bot application:
1

Create Application

Go to the Discord Developer Portal and create a New Application. Give it a meaningful name.
2

Get Bot Token

Navigate to the Bot tab:
  • Click Reset Token to generate your DISCORD_TOKEN
  • Save this token securely - you’ll need it in the next step
  • Under Privileged Gateway Intents, enable Message Content Intent
3

Configure Permissions

Navigate to OAuth2 → URL Generator:
  • Select Scopes: bot, applications.commands
  • Select Bot Permissions:
    • View Channels
    • Send Messages
    • Embed Links
    • Read Message History (Required for the !register command)
  • Copy the generated URL
4

Invite Bot to Server

Use the generated URL to invite the bot to your Discord server. Make sure you have “Manage Server” permissions.
5

Get Application ID (Optional)

Navigate to General Information tab:
  • Copy the Application ID - needed for ENABLE_AUTOREGISTER_CMD feature

Step 2: Deploy with Docker Compose

Now let’s get the bot running:
1

Clone Repository

git clone https://github.com/FAZuH/pwr-bot
cd pwr-bot
2

Configure Environment

Copy the example environment file and edit it with your values:
cp .env-example .env
# Edit .env with your favorite text editor
nano .env  # or vim, code, etc.
At minimum, set these required variables:
.env
DISCORD_TOKEN=your_discord_token_here
ADMIN_ID=your_discord_user_id
To find your Discord User ID: Enable Developer Mode in Discord settings, then right-click your username and select “Copy User ID”.
Optional configuration:
.env
POLL_INTERVAL=180                    # Feed polling interval (seconds)
DATABASE_PATH=./data/data.db         # SQLite database path
LOGS_PATH=./logs                     # Log file directory
ENABLE_VOICE_TRACKING=true           # Voice channel tracking
ENABLE_FEED_PUBLISHER=true           # Feed update notifications
ENABLE_AUTOREGISTER_CMD=true         # Auto-register commands
DISCORD_APPLICATION_ID=1234567890    # From Discord Developer Portal
RUST_LOG=pwr_bot=info               # Log level
3

Start the Bot

Launch the bot using Docker Compose:
docker compose up -d
The bot will:
  • Pull the latest image from GitHub Container Registry
  • Create persistent volumes for data and logs
  • Start in detached mode
  • Automatically restart unless stopped manually
The docker-compose.yml configuration:
name: pwr-bot

services:
  app:
    image: ghcr.io/fazuh/pwr-bot:latest
    volumes:
      - data:/app/data
      - logs:/app/logs
    environment:
      - DISCORD_TOKEN=${DISCORD_TOKEN:?error}
      - ADMIN_ID=${ADMIN_ID:?error}
      # ... other variables with defaults
    restart: unless-stopped

volumes:
  data:
  logs:
4

Verify Bot is Running

Check the bot’s logs to ensure it started successfully:
docker compose logs -f app
You should see output like:
pwr-bot is up in 2.30s. Press Ctrl+C to stop.
Press Ctrl+C to exit the logs view.

Step 3: Register Commands

After the bot is running, register the slash commands:
1

Use the Registration Command

In any channel where the bot has access, type:
!register_owner
This command only works if your Discord User ID matches the ADMIN_ID in your .env file.
2

Choose Registration Scope

The bot will respond with buttons:
  • Register in guild - Commands available immediately in this server only (recommended for testing)
  • Register globally - Commands available in all servers (may take up to 1 hour to propagate)
Click your preferred option.
For server administrators (without owner access), use !register or !unregister commands instead. These require “Administrator” or “Manage Server” permissions.

Step 4: Test Your Bot

Try out the bot’s features:

Feed Subscription Example

Subscribe to an anime or manga feed:
/feed subscribe links:https://anilist.co/anime/21
The bot will:
  • Parse and validate the URL
  • Create a subscription for your DM
  • Send you notifications when new episodes/chapters are released

Voice Tracking Example

View the voice activity leaderboard:
/voice leaderboard
This displays:
  • Server-wide voice activity rankings
  • Your current position
  • Total time spent in voice channels
  • Customizable time ranges (24h, 7d, this month, etc.)

Next Steps

Now that your bot is running:

Configure Settings

Explore all configuration options and customize behavior

Feed Subscriptions

Learn about supported platforms and subscription management

Voice Tracking

Set up voice channel tracking and view detailed statistics

Commands Reference

See all available commands and their options

Troubleshooting

Bot won’t start

  • Verify your DISCORD_TOKEN is correct
  • Ensure Docker is running
  • Check logs: docker compose logs app

Commands not appearing

  • Wait a few minutes after registration
  • For guild registration: Commands should appear immediately
  • For global registration: May take up to 1 hour
  • Try kicking and re-inviting the bot

Permission errors

  • Verify the bot has required permissions in your server
  • Check that “Message Content Intent” is enabled in Discord Developer Portal
  • Ensure your user ID matches ADMIN_ID for owner commands

Database issues

  • Database migrations run automatically on startup
  • Check that the data volume has write permissions
  • View logs for migration errors: docker compose logs app | grep migration

Managing Your Bot

View Logs

docker compose logs -f app

Stop the Bot

docker compose down

Restart the Bot

docker compose restart

Update to Latest Version

docker compose pull
docker compose up -d

Backup Database

docker compose exec app cat /app/data/data.db > backup.db
Always backup your database before updating to a new version.

Build docs developers (and LLMs) love