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
How to run a released build depends on where you want it to run.
As a Python package
Install from PyPI and run the pibot console script:
pip install pibot
# or: uv add pibot
pibot
As a container image
Each release publishes the same image to Docker Hub and to GitHub Container Registry (workflow).
| Registry | Image reference (example) |
|---|---|
| Docker Hub | tobiasgoetz/pibot: docker run --env-file .env tobiasgoetz/pibot:latest |
| GHCR | ghcr.io/tobiasgoetz/pibot:latest (and version tags; path uses a lowercased GitHub owner/repo) — e.g. docker run --env-file .env ghcr.io/tobiasgoetz/pibot:latest |
To build an image from this repository locally, see Docker below.
On Kubernetes
Install the published Helm chart from GHCR OCI (workflow). Use an app version that matches pyproject.toml / the GitHub release:
helm install pibot oci://ghcr.io/tobiasgoetz/helm-charts/pibot --version <version>
You can configure the deployment via the chart values file (and overrides); see charts/pibot/README.md.
Further release and command details: AGENTS.md.
Environment variables
Configure these for docker run, Helm values, or a .env file (see .env.example). Names match what the process reads via the environment.
| Variable | Required | Default | Options | Description |
|---|---|---|---|---|
DISCORD_TOKEN |
Required | — | — | Bot token from the Discord Developer Portal. |
MONGODB_URI |
Required | — | Standard MongoDB URI (mongodb://…, mongodb+srv://…, etc.) |
Connection string for your MongoDB instance (local or Atlas). |
DEEPL_API_KEY |
Required | — | — | DeepL API key; required because the translation cog loads at startup. |
COMMAND_SYNC_BEHAVIOR |
Optional | global |
global, local |
Startup slash-command sync: global runs a global Discord sync; local skips it (use DevTools guild sync). Invalid or unset → global. See command_sync_behavior() and COMMAND_SYNC_BEHAVIOR in pibot/settings.py. |
ENABLE_DEV_TOOLS |
Optional | false |
true, false (also 1 / 0) |
Load the DevTools cog when true. Unset → false. See is_dev_tools() in pibot/settings.py. |
LOG_LEVEL |
Optional | INFO |
DEBUG, INFO, WARNING, ERROR, CRITICAL |
Logging level for discord.utils.setup_logging (and thus the root logger). Use DEBUG to see logger.debug output from PiBot and discord. Unknown values fall back to INFO. |
Local development
Prerequisites
- Python 3.14 or higher
- uv package manager
- MongoDB instance (local or remote)
- Discord bot token from Discord Developer Portal
Setup
-
Clone the repository
git clone https://github.com/TobiasGoetz/pibot.git cd pibot
-
Install dependencies
uv sync -
Set up environment variables
Copy the example environment file and create your
.envfile with your values:cp .env.example .env
Edit
.envwith your actual values. See Environment variables for the full list. -
Run the bot
uv run pibot
Behaviour in development
Defaults are COMMAND_SYNC_BEHAVIOR=global and ENABLE_DEV_TOOLS=false. For local development without global sync at startup, set COMMAND_SYNC_BEHAVIOR=local; enable DevTools with ENABLE_DEV_TOOLS=true and use DevTools sync for guild-scoped command testing. See AGENTS.md.
Linting, types, docs, and releases
See AGENTS.md for Ruff/ty commands, Sphinx doc regeneration, Docker/Helm/PyPI flows, and Release Please.
Docker (local builds)
To build and run the image on your machine (no registry push):
docker build -t pibot:local .
docker run --env-file .env pibot:local
For day-to-day development, uv run pibot is usually faster than rebuilding images.
Metadata
Release files for pibot-discord 3.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pibot_discord-3.6.0.tar.gz | 14.7 kB | Without provenance | Details for pibot_discord-3.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pibot_discord-3.6.0-py3-none-any.whl | Python 3 | none | any | Details for pibot_discord-3.6.0-py3-none-any.whl |
Total release size: 36.2 kB
Release files / pibot_discord-3.6.0.tar.gz
| Download URL | pibot_discord-3.6.0.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22c0b8590f34c488db10f7255b4d972dce498d618ec34cab580282f800b7efe2
|
|
BLAKE2b-256 checksum How to use checksums |
53b235b5b0bb058108b80a436b18006aaa9747fce1a0d6690dbd55af67764c2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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}
|
Release files / pibot_discord-3.6.0-py3-none-any.whl
| Download URL | pibot_discord-3.6.0-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09523c8c1a97b3bfecd25c36f560e058f1db4d741a9466bdf07f78be3572b53f
|
|
BLAKE2b-256 checksum How to use checksums |
e22ca6553f4d2029453a8cc8b51443f5aec62747822740aeefa498721f3dbe5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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}
|
Security for pibot-discord 3.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.