Metadata-Version: 2.3
Name: pibot-discord
Version: 3.4.5
Summary: Multi-purpose Discord Bot
Keywords: python,discord,bot,moderation,fun,utility
Author: Tobias Goetz
Author-email: Tobias Goetz <contact@tobiasgoetz.com>
Requires-Dist: deepl>=1.28,<1.31
Requires-Dist: discord-py~=2.7.1
Requires-Dist: pymongo~=4.16.0
Requires-Dist: python-dotenv~=1.2.2
Requires-Dist: pytimeparse~=1.1.8
Requires-Python: ~=3.14.0
Project-URL: Homepage, https://github.com/TobiasGoetz/pibot
Project-URL: Issues, https://github.com/TobiasGoetz/pibot/issues
Description-Content-Type: text/markdown

# 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](#docker) below).

# Local Development

## Prerequisites

* Python 3.14 or higher
* [uv](https://github.com/astral-sh/uv) package manager
* MongoDB instance (local or remote)
* Discord bot token from [Discord Developer Portal](https://discord.com/developers/applications)

## Setup

1. **Clone the repository**
   ```bash
   git clone https://github.com/TobiasGoetz/pibot.git
   cd pibot
   ```

2. **Install dependencies**
   ```bash
   uv sync
   ```

3. **Set up environment variables**
   
   Copy the example environment file and create your `.env` file with your values:
   ```bash
   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**
   ```bash
   uv run pibot
   ```

## Development Workflow

### Running the Bot

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

```bash
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:

```bash
uv run ruff check .
uv run ruff format .
```

## Documentation

Update generated API docs using:
```bash
uv run --group docs sphinx-apidoc -f -o docs/source src/pibot
```

Verify docs compile cleanly (warnings as errors) using:
```bash
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:

```bash
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):
   ```bash
   docker buildx create --use --name pibot
   ```

2. Build and push multi-arch image to Docker Hub:
   ```bash
   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.