Skip to main content
pwr-bot is configured using environment variables. These can be set in a .env file or passed directly to the Docker container.

Configuration File

When running pwr-bot, create a .env file in the same directory as the binary or use it with Docker. You can download the .env-example file as a starting point.
POLL_INTERVAL=180
DATABASE_PATH=./data/data.db
DATABASE_URL=sqlite://data.db
DISCORD_TOKEN=discord-bot-token
DISCORD_APPLICATION_ID=1234567890
RUST_LOG=pwr_bot=info
ADMIN_ID=123
LOGS_PATH=./logs
DATA_PATH=./data
ENABLE_VOICE_TRACKING=true
ENABLE_FEED_PUBLISHER=true
ENABLE_AUTOREGISTER_CMD=true

Required Variables

These variables must be set for pwr-bot to function.
DISCORD_TOKEN
string
required
Your Discord bot token obtained from the Discord Developer Portal.Get this from: Bot tab → Reset Token
Never commit this token to version control or share it publicly.
ADMIN_ID
string
required
Your Discord user ID. This grants access to admin commands like !register_owner.To find your user ID:
  1. Enable Developer Mode in Discord (User Settings → Advanced → Developer Mode)
  2. Right-click your username and select “Copy User ID”

Optional Variables

These variables have default values and can be customized as needed.

Discord Configuration

DISCORD_APPLICATION_ID
string
default:"1234567890"
Your Discord Application ID from the Developer Portal.Required for: Command autoregistration feature (when ENABLE_AUTOREGISTER_CMD=true)Get this from: General Information tab → Application ID

Feature Toggles

ENABLE_VOICE_TRACKING
boolean
default:"true"
Enable voice channel activity tracking and heartbeat monitoring.When enabled, the bot tracks time spent in voice channels and provides leaderboard commands.
ENABLE_FEED_PUBLISHER
boolean
default:"true"
Enable feed polling and publishing for anime/manga subscriptions.When enabled, the bot checks for updates from AniList, MangaDex, and Comick at the interval specified by POLL_INTERVAL.
ENABLE_AUTOREGISTER_CMD
boolean
default:"true"
Enable the autoregister command feature.When enabled, users with appropriate permissions can use !register to automatically register slash commands.Requires: DISCORD_APPLICATION_ID to be set

Paths and Storage

DATABASE_PATH
string
default:"./data/data.db"
Path to the SQLite database file.The bot will create this file if it doesn’t exist. Ensure the parent directory exists and is writable.
DATABASE_URL
string
default:"sqlite://data.db"
SQLite database connection URL.Used internally by SQLx. Should match the DATABASE_PATH in URL format.
DATA_PATH
string
default:"./data"
Directory for storing data files including the database.The bot will create this directory if it doesn’t exist.
LOGS_PATH
string
default:"./logs"
Directory for storing application log files.The bot will create this directory if it doesn’t exist.

Behavior Settings

POLL_INTERVAL
number
default:"180"
Feed polling interval in seconds.How often the bot checks for new anime/manga updates. Minimum recommended: 60 seconds.
Lower values mean more frequent updates but higher API usage.
RUST_LOG
string
default:"pwr_bot=info"
Logging level configuration.Controls the verbosity of application logs. Common values:
  • pwr_bot=error - Only errors
  • pwr_bot=warn - Warnings and errors
  • pwr_bot=info - General information (recommended)
  • pwr_bot=debug - Detailed debugging information
  • pwr_bot=trace - Very verbose debugging
For more advanced configuration, see the Rust log documentation.

Docker-Specific Configuration

When using Docker, environment variables can be passed in multiple ways:
Edit the .env file in the same directory as docker-compose.yml:
DISCORD_TOKEN=your_token_here
ADMIN_ID=your_user_id
POLL_INTERVAL=180
Then start with:
docker compose up -d

Example Configurations

Minimal setup with only required variables:
DISCORD_TOKEN=your_discord_token_here
ADMIN_ID=your_discord_user_id
Recommended production setup with custom paths:
DISCORD_TOKEN=your_discord_token_here
DISCORD_APPLICATION_ID=your_application_id
ADMIN_ID=your_discord_user_id
POLL_INTERVAL=180
DATABASE_PATH=/var/lib/pwr-bot/data.db
LOGS_PATH=/var/log/pwr-bot
DATA_PATH=/var/lib/pwr-bot
RUST_LOG=pwr_bot=info
ENABLE_VOICE_TRACKING=true
ENABLE_FEED_PUBLISHER=true
ENABLE_AUTOREGISTER_CMD=true
Setup for development with verbose logging:
DISCORD_TOKEN=your_discord_token_here
DISCORD_APPLICATION_ID=your_application_id
ADMIN_ID=your_discord_user_id
POLL_INTERVAL=60
RUST_LOG=pwr_bot=debug,serenity=debug
ENABLE_VOICE_TRACKING=true
ENABLE_FEED_PUBLISHER=true
ENABLE_AUTOREGISTER_CMD=true
Run only feed subscription features without voice tracking:
DISCORD_TOKEN=your_discord_token_here
ADMIN_ID=your_discord_user_id
POLL_INTERVAL=300
ENABLE_VOICE_TRACKING=false
ENABLE_FEED_PUBLISHER=true
ENABLE_AUTOREGISTER_CMD=true

Next Steps

After configuring your environment:
  1. Choose your installation method:
  2. See the command registration steps in the Quick Start guide

Build docs developers (and LLMs) love