- Python 98.5%
- Dockerfile 1.5%
| core | ||
| discord_bot | ||
| .gitignore | ||
| config.yaml.example | ||
| Dockerfile | ||
| LICENSE | ||
| main.py | ||
| README.md | ||
| requirements.txt | ||
Pelibot - Discord × Pelican Server Control Bot
A lightweight Discord bot that allows you to manage Pelican-managed servers directly from Discord channels.
The bot connects to the Pelican API and exposes basic server controls (start, stop, restart, kill) through Discord, using a simple YAML configuration to map servers to channels with fine-grained permissions.
Features
- Control Pelican servers from Discord
- Per-channel server mapping
- Per-channel permissions (
start,stop,restart,kill) - Configuration-driven (single YAML file)
- Tokens handled via environment variables
- Dockerized for easy deployment
Architecture Overview
-
Pelican API is used to control servers
-
Discord bot listens to commands in specific channels
-
YAML configuration defines:
- Pelican instance
- Managed servers
- Discord channels and allowed power actions
-
Docker ensures consistent runtime and simple deployment
The bot does not require a GUI and is designed to run as a background service.
Configuration
The bot is configured via a YAML file:
pelican:
domain_name: "pelican.example.com"
token: ${PELICAN_TOKEN}
servers:
server-name-1:
pelican_uuid: <pelican-uuid>
server-name-2:
pelican_uuid: <pelican-uuid>
discord:
token: ${DISCORD_TOKEN}
channels:
"<channel_id_1>":
server_name: "server-name-1"
permissions: "start,stop,restart,kill"
"<channel_id_2>":
server_name: "server-name-2"
permissions: "start,restart"
Notes
- Tokens can be provided directly or via environment variables
- Each Discord channel controls exactly one server
- Permissions are enforced per channel
Usage
Once running, the bot listens for commands in the configured Discord channels corresponding to p.
List of commands :
startstoprestartkill
Commands are only executed if explicitly allowed in the channel configuration.
Running with Docker
A Dockerfile is provided to simplify deployment.
Build
docker build -t pelibot .
Run
The bot can be run using either docker run or docker compose:
Via docker run
docker run \
-e DISCORD_TOKEN=your_discord_token \
-e PELICAN_TOKEN=your_pelican_token \
-v ./config.yaml:/app/config.yaml \
pelibot
Via docker compose
- docker-compose.yml
services:
pelibot:
container_name: pelibot
image: pelibot
restart: unless-stopped
volumes:
- ./config.yaml:/app/config.yaml
environment:
- PELICAN_TOKEN=${PELICAN_TOKEN}
- DISCORD_TOKEN=${DISCORD_TOKEN}
- .env
PELICAN_TOKEN=<pelican-client-api-token>
DISCORD_TOKEN=<discord-bot-token>
Project Status
The bot is functional and can be used in production for simple server management workflows.
The project is currently focused on consolidating its internal architecture and developer experience. Planned improvements include:
- YAML configuration validation
- Static typing
- Improved documentation and docstrings
- Automated tests