Discord bot written in python to manage pelican servers from discord channels
  • Python 98.5%
  • Dockerfile 1.5%
Find a file
2026-02-08 16:04:19 +01:00
core (discord_bot/discord_client.py) Fixed unconfigured channels being watched 2026-02-04 14:52:01 +01:00
discord_bot (discord_bot/discord_client.py) Fixed unconfigured channels being watched 2026-02-04 14:52:01 +01:00
.gitignore Initialized project structure 2025-12-02 18:49:00 +01:00
config.yaml.example Implemeted basic action permission system per channel and kill power action 2025-12-10 01:42:36 +01:00
Dockerfile Changed Workdir in Dockerfile 2025-12-03 23:31:04 +01:00
LICENSE Update LICENSE to GPL-3.0-or-later 2026-02-08 16:04:19 +01:00
main.py (discord_bot/discord_client.py) Fixed unconfigured channels being watched 2026-02-04 14:52:01 +01:00
README.md (README.md) Removed project version 2026-02-08 15:05:49 +01:00
requirements.txt Added requirements.txt 2025-12-03 19:47:34 +01:00

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 :

  • start
  • stop
  • restart
  • kill

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