The Bleu Pigs mascot
- Luau 99.4%
- Nix 0.4%
- Dockerfile 0.2%
| .github | ||
| docs | ||
| libs/bleucord | ||
| planning | ||
| src | ||
| tests | ||
| .editorconfig | ||
| .env.example | ||
| .envrc | ||
| .gitignore | ||
| .luaurc | ||
| COMMANDS.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
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
- Clone the repository
- Copy
.env.exampleto.envand fill in required values - Place BleuCord and BleuBlox libraries under
/libs - 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 serversmembers/community_members— Member profiles and community membershipapplications/application_votes— Application workflowcases/case_notes/case_relations— Case managementaudit_logs/message_archive— Audit trailmember_activity/engagement_points/weekly_challenges— Engagement trackingnews_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.