The Bleu Pigs mascot
  • Luau 99.4%
  • Nix 0.4%
  • Dockerfile 0.2%
Find a file
2026-02-08 21:59:01 -06:00
.github getting started 2026-02-08 20:52:02 -06:00
docs initial build 2026-02-08 21:59:01 -06:00
libs/bleucord initial build 2026-02-08 21:59:01 -06:00
planning getting started 2026-02-08 20:52:02 -06:00
src initial build 2026-02-08 21:59:01 -06:00
tests initial build 2026-02-08 21:59:01 -06:00
.editorconfig getting started 2026-02-08 20:52:02 -06:00
.env.example initial build 2026-02-08 21:59:01 -06:00
.envrc getting started 2026-02-08 20:52:02 -06:00
.gitignore getting started 2026-02-08 20:52:02 -06:00
.luaurc initial build 2026-02-08 21:59:01 -06:00
COMMANDS.md getting started 2026-02-08 20:52:02 -06:00
docker-compose.yml initial build 2026-02-08 21:59:01 -06:00
Dockerfile initial build 2026-02-08 21:59:01 -06:00
flake.lock initial build 2026-02-08 21:59:01 -06:00
flake.nix getting started 2026-02-08 20:52:02 -06:00
README.md initial build 2026-02-08 21:59:01 -06:00

PigBot v1.0.0

PigBot is a multi-service Discord bot appliance for Bleu Pigs community management. Built with BleuMoon (Luau runtime) and BleuCord (Discord library).

Features

  • Membership Application Process — Quality-focused application workflow with voting, probation, and grandfathering
  • Roblox News Updates — Automatic monitoring of DevForum, Blog, Release Notes, and Status Page
  • Community Engagement — Activity tracking, challenges, leaderboards, VC notifications
  • Audit Logging — Comprehensive event tracking with color-coded Discord embeds and configurable retention
  • Case-Based Framework — Structured case management (Applications, Moderation, Change Requests, Bug Reports, Appeals)

Quick Start

Prerequisites

  • BleuMoon/Lune runtime
  • PostgreSQL 16+
  • Docker & Docker Compose (for deployment)

Development Setup

  1. Clone the repository
  2. Copy .env.example to .env and fill in required values
  3. Place BleuCord and BleuBlox libraries under /libs
  4. Run the bot:
    lune run src/main
    

Docker Deployment

# Copy and configure environment
cp .env.example .env
# Edit .env with your Discord token, database credentials, etc.

# Start all containers
docker compose up -d

Running Tests

lune run tests/run

Project Structure

pigbot/
├── src/
│   ├── main.luau              # Entry point
│   ├── config.luau            # Environment configuration
│   ├── bot/
│   │   ├── init.luau          # Bot client initialization
│   │   ├── events/
│   │   │   └── router.luau    # Discord event routing
│   │   └── commands/
│   │       ├── registry.luau  # Command registration & routing
│   │       ├── case.luau      # /case command
│   │       ├── community.luau # /community command
│   │       ├── member.luau    # /member command
│   │       ├── engagement.luau# /engagement command
│   │       ├── news.luau      # /news command
│   │       └── audit.luau     # /audit command
│   ├── services/
│   │   ├── audit.luau         # Audit log formatting & dispatch
│   │   ├── engagement.luau    # Engagement tracking & points
│   │   ├── membership.luau    # Application, probation, inactivity
│   │   ├── news.luau          # Roblox news polling & distribution
│   │   └── scheduler.luau     # Periodic task scheduling
│   ├── database/
│   │   ├── init.luau          # DB connection & migration runner
│   │   ├── migrations.luau    # Schema migrations (7)
│   │   └── repos/
│   │       ├── community.luau # Community CRUD
│   │       ├── member.luau    # Member management
│   │       ├── application.luau# Application workflow
│   │       ├── audit.luau     # Audit log storage
│   │       ├── case.luau      # Case management
│   │       ├── engagement.luau# Engagement data
│   │       └── news.luau      # News items & distribution
│   └── utils/
│       ├── logger.luau        # Structured logging
│       └── helpers.luau       # Utility functions
├── tests/
│   ├── run.luau               # Test runner
│   ├── utils.luau             # Test framework & mocks
│   └── test_*.luau            # Test suites
├── libs/                      # Dependencies (BleuCord, BleuBlox)
├── docker-compose.yml         # Multi-container deployment
├── Dockerfile                 # Application container
└── planning/
    └── release-1.0.0.md       # Release specification

Slash Commands

Command Description Permission
/case create|view|update|assign|... Case management (10 subcommands)
/community setup|config|info|roles Community management Administrator
/member info|register|grandfather|activity Member management
/engagement leaderboard|challenges|points|vc-notify|analytics Engagement system
/news config|recent|sources|enable|disable News configuration Manage Channels
/audit logs|search|critical Audit log viewing View Audit Log

Database

PigBot uses PostgreSQL with automatic migrations. The schema includes:

  • communities — Managed Discord servers
  • members / community_members — Member profiles and community membership
  • applications / application_votes — Application workflow
  • cases / case_notes / case_relations — Case management
  • audit_logs / message_archive — Audit trail
  • member_activity / engagement_points / weekly_challenges — Engagement tracking
  • news_items / news_distributions — News system

Retention Policy

Category Retention
Critical events (bans, kicks, role changes) Indefinite
Message content 90 days
Member activity 180 days
General events 60 days

Configuration

All configuration is via environment variables. See .env.example for the full list.

Key settings:

Variable Default Description
DISCORD_TOKEN required Bot token
DATABASE_URL required PostgreSQL connection string
APPLICATION_VOTING_DAYS 7 Days for application voting
APPLICATION_APPROVAL_THRESHOLD 70 Approval percentage needed
APPLICATION_COOLDOWN_DAYS 90 Cooldown after denial
PROBATION_PERIOD_DAYS 30 New member probation
MINIMUM_WEEKLY_MESSAGES 5 Weekly activity requirement
NEWS_POLL_INTERVAL 900 News polling interval (seconds)

License

Internal use only — Bleu Pigs.