Skip to content
/ pwr-bot Public

Discord bot for tracking anime and manga updates

License

Notifications You must be signed in to change notification settings

FAZuH/pwr-bot

Repository files navigation

pwr-bot

Discord bot that sends feed update notifications to your DM or server.

Table of Contents

Features

  • Multi-Source Support: Subscribe to updates from AniList, MangaDex, and Comick.
  • Flexible Notifications: Receive updates via Discord Direct Messages (DMs) or server channels.
  • Lightning Fast: (Metrics based on v0.1.15)
    • Application initialization: ~0.3s
    • Bot initialization: ~2s
  • Lightweight: (Metrics based on v0.1.15)
    • Binary size: 21.2 MB
    • Docker image: 46.4 MB
image image image image

Discord Setup

Before running the bot, you need to create a Discord application:

  1. Go to the Discord Developer Portal.
  2. Create a New Application and give it a name.
  3. Navigate to the Bot tab:
    • Click Reset Token to get your DISCORD_TOKEN.
    • Under Privileged Gateway Intents, enable Message Content Intent.
  4. 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)
  5. Use the generated URL to invite the bot to your server.

Installation & Usage

You can run this bot using Docker (recommended) or manually using the pre-compiled binary.

Docker (Recommended)

Prerequisites

Option 1: Docker Compose (Recommended)

  1. Clone the repository

    git clone https://github.com/FAZuH/pwr-bot
    cd pwr-bot
  2. Configuration Copy the example environment file and configure it:

    cp .env-example .env
    # Edit .env with your text editor
  3. Run Start the bot in detached mode:

    docker compose up -d

Option 2: Docker Run

If you prefer to run the container directly without docker compose or cloning the full repository source code:

  1. Prepare Directories Create directories to persist data and logs:

    mkdir -p pwr-bot/data pwr-bot/logs
    cd pwr-bot
  2. Run Start the container (make sure you replace the placeholder values):

    docker run -d \
      --name pwr-bot \
      --restart unless-stopped \
      -v $(pwd)/data:/app/data \
      -v $(pwd)/logs:/app/logs \
      -e DISCORD_TOKEN="your_discord_token_here" \
      -e ADMIN_ID="your_admin_id_here" \
      ghcr.io/fazuh/pwr-bot:latest

    Alternatively, you can use an env file:

    # Assuming you have a .env file in the current directory
    docker run -d \
      --name pwr-bot \
      --restart unless-stopped \
      --env-file .env \
      -v $(pwd)/data:/app/data \
      -v $(pwd)/logs:/app/logs \
      ghcr.io/fazuh/pwr-bot:latest

Manual (Binary)

Steps

  1. Download the latest binary Download the latest binary for your platform from the GitHub Releases.

  2. Configuration Download the .env-example file, rename it to .env in the same directory as the binary, and configure it with your text editor.

  3. Run

    # If on Linux/macOS, make the binary executable first
    chmod +x pwr-bot
    ./pwr-bot

Command Registration

After the bot is running and invited to your server, you need to register the slash commands:

  1. In any channel the bot has access to, type !register_owner.
  2. The bot will respond with buttons to register the commands.
  3. Click Register in guild (immediate) or Register globally (may take up to an hour).

Note

Note that !register_owner command requires your Discord user ID to match environment variable's ADMIN_ID.

Users in other servers with "Administrator" or "Manage Server" permissions can simply run !register or !unregister.

image

Configuration

See .env-example for available configuration options.

Variable Description Default
DISCORD_TOKEN Your Discord bot token Required
ADMIN_ID Discord User ID for admin commands Required
POLL_INTERVAL Feed polling interval in seconds 180
DATABASE_PATH Path to SQLite DB file ./data/data.db
LOGS_PATH Directory for logs ./logs
RUST_LOG Log level (e.g., info, debug. Read here for more info) pwr_bot=info

Notes and Tips

  • Database: The application uses SQLite. Migrations are handled automatically on startup.
  • Logs: Application logs are stored in the configured LOGS_PATH (default: logs/ directory).
  • Docker Volumes: If you are using Docker, make sure data/ and logs/ are mounted to persist data and logs between restarts.

Bug Reports and Feature Requests

You can report bugs or request for features on the issue tracker.

License

pwr-bot is distributed under the terms of the MIT license.

About

Discord bot for tracking anime and manga updates

Resources

License

Stars

Watchers

Forks

Packages