Skip to main content

Multi-purpose Discord Bot

Project description

PiBot

A discord bot providing administration and utility features!

Features

  • Easy to run (uses Python)
  • Modular cog-based architecture
  • MongoDB integration for guild settings
  • DeepL translation support
  • Development tools for testing

Installation

You can run PiBot in two ways:

  • From PyPI (after publishing): pip install pibot or uv add pibot, then run pibot.
  • From Docker: use the image tobiasgoetz/pibot from Docker Hub (see Docker below).

Local Development

Prerequisites

Setup

  1. Clone the repository

    git clone https://github.com/TobiasGoetz/pibot.git
    cd pibot
    
  2. Install dependencies

    uv sync
    
  3. Set up environment variables

    Copy the example environment file and create your .env file with your values:

    cp .env.example .env
    

    Edit .env with your actual values. The .env.example file contains all required and optional environment variables with descriptions.

  4. Run the bot

    uv run pibot
    

Development Workflow

Running the Bot

The recommended way to run the bot during development is using uv directly:

uv run pibot

This provides:

  • Fast iteration (no Docker rebuilds needed)
  • Easy debugging with IDE integration
  • Direct access to logs and file system

Development Features

When ENVIRONMENT is not set to production or testing:

  • DevTools cog is automatically loaded with development commands
  • Commands sync locally (not globally) for faster testing
  • Additional debugging features are available

Code Quality

The project uses ruff for linting and formatting. Run it with:

uv run ruff check .
uv run ruff format .

Documentation

Update generated API docs using:

uv run --group docs sphinx-apidoc -f -o docs/source src/pibot

Verify docs compile cleanly (warnings as errors) using:

uv run --group docs sphinx-build -T -n -W -b html docs docs/_build/html

Docker

Testing Docker Build Locally

To test the Docker build locally without publishing:

docker build -t pibot:local .
docker run --env-file .env pibot:local

Building and Publishing Multi-Architecture Images

⚠️ This will publish to Docker Hub. Make sure you're logged in with docker login before running.

To build and publish multi-architecture images from your local machine:

  1. Create buildx builder (one-time setup):

    docker buildx create --use --name pibot
    
  2. Build and push multi-arch image to Docker Hub:

    docker buildx build --platform linux/amd64,linux/arm64 --push -t tobiasgoetz/pibot .
    

    This command will build the image for both AMD64 and ARM64 architectures and push it to Docker Hub.

Note: For active development, using uv directly is recommended over Docker for faster iteration.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pibot_discord-3.4.5.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pibot_discord-3.4.5-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file pibot_discord-3.4.5.tar.gz.

File metadata

  • Download URL: pibot_discord-3.4.5.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pibot_discord-3.4.5.tar.gz
Algorithm Hash digest
SHA256 b8019daead003bd0ec71c2fbbc2545dffabba3fb421203e8304289a7700a8324
MD5 b1377354ae8a4544aba4f653428fbe07
BLAKE2b-256 e1f370559a119c2b31a0f18e71abaf869927a372647fbf1e5b9939def058b5bb

See more details on using hashes here.

File details

Details for the file pibot_discord-3.4.5-py3-none-any.whl.

File metadata

  • Download URL: pibot_discord-3.4.5-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pibot_discord-3.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1d01d9ee755db3df9dc9be009f79ec2ced1807fb38e87329c0bec44f9f4f9e50
MD5 e7438873b5ebcb350f78186f4b2efc06
BLAKE2b-256 6c2c5b6fd764704e852b46f284a90f57f7e1c18295d2587c8d10b031eadc8759

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page