Discord bot for community gating and moderation
Staff? Read these first:
- BOT-HANDBOOK -- Every command, explained
- MOD-QUICKREF -- Cheat sheet for daily mod work
- PERMS-MATRIX -- Who can run what
Pawtropolis Tech is a server-owned verification system that handles community onboarding through structured application flows. It replaces manual DM-based screening with a permission-gated workflow so staff stay accountable and applicants stay informed.
Every review action is logged, every decision is attributable, and the bot stays out of the way when it has no work to do.
# Clone and install
git clone https://github.com/watchthelight/pawtropolis-tech.git
cd pawtropolis-tech
npm install
# Configure environment
cp .env.example .env
# Edit .env with your DISCORD_TOKEN and CLIENT_ID
# Run all checks
npm run check
# Start development server
npm run devKey Scripts:
| Command | Description |
|---|---|
npm run dev |
Development mode with hot reload |
npm run build |
Build for production |
npm run test |
Run test suite |
npm run check |
Run all quality checks |
npm run deploy:cmds |
Deploy slash commands to Discord |
- Interactive modal forms with multi-page question flows
- Configurable per-guild questions via SQLite schema
- Draft recovery for incomplete applications
- Submission validation with required field enforcement
- Reviewer dashboards with rich embeds and action buttons
- Claim system to prevent review collisions
- Full audit trail of approve/reject/kick decisions
- Permanent rejection feature to block repeat applications
- Private thread bridge for staff-applicant DM routing
- Automatic transcript logging
- Bidirectional message forwarding with reply threading
- Google Cloud Vision SafeSearch integration
- Configurable detection thresholds
- One-click Google Lens reverse image search
- Health monitoring with uptime checks, an off-process database integrity check every 6 hours, and event-loop lag tracking on the dashboard system page
- Retention scheduler: hourly action-log search index catch-up, daily
PRAGMA optimize, and flag-gated pruning of expired rows, deploy backups and 30-day-old verification posts (RETENTION_ENABLED=true) - Sentry integration for error tracking (profiling is opt-in)
- Pino-based structured JSON logging (asynchronous, flushed on shutdown)
- Documentation parity tests: the handbook, command reference, permission matrix, env examples and dashboard config editor are checked against the code by
npm test
| Variable | Description |
|---|---|
DISCORD_TOKEN |
Bot token from Discord Developer Portal |
CLIENT_ID |
Application ID from Discord Developer Portal |
| Variable | Description |
|---|---|
GUILD_ID |
Guild ID for per-guild command registration |
SENTRY_DSN |
Sentry error tracking DSN |
LOG_LEVEL |
Pino log level (trace/debug/info/warn/error); production runs info |
RESET_PASSWORD |
Password for admin reset commands |
DB_HEALTHCHECK_MODE |
Boot-time integrity check: quick (production default), full or skip |
RETENTION_ENABLED |
Lets the retention scheduler delete instead of logging a dry run |
SENTRY_PROFILES_SAMPLE_RATE |
Opt-in CPU profiling (0 disables and skips loading the profiler) |
Every variable the code reads, with its default, is in .env.example (bot) and web/.env.example (dashboard); tests/docs/env-example.test.ts fails when either file and the code disagree.
# 1. Configure the gate system
/gate setup review_channel:#staff-review gate_channel:#gate general_channel:#general accepted_role:@Verified
# 2. Customize questions (optional)
/gate set-questions q1:"What is your age?" q2:"How did you find us?"
# 3. Preview welcome message
/gate welcome preview| Command | Description |
|---|---|
/gate setup |
Initialize guild configuration |
/gate status |
View application statistics |
/accept @user |
Approve application |
/reject @user reason:"..." |
Reject with reason |
/modstats |
View moderator statistics |
For full command reference, see docs/BOT-HANDBOOK.md.
| Document | Description |
|---|---|
| BOT-HANDBOOK.md | Complete command reference |
| MOD-QUICKREF.md | Quick reference for moderators |
| PERMS-MATRIX.md | Permission requirements |
| CHANGELOG.md | Version history |
| github-discord-badges | GitHub-renderable Discord role/channel badges |
GitHub Markdown cannot render Discord mention syntax. Pawtropolis Tech
generates SVG pill badges that look like Discord mentions, use real role
names and colors, and are refreshed daily. Docs reference them as
 instead of raw
<@&id> strings. See docs/reference/github-discord-badges.md
for the full system.
Licensed under the Attribution-No Wholesale Copying License (ANW-1.0).
You can use and modify the code for your own projects with proper attribution. You cannot redistribute the entire project as-is or rebrand it as your own work.
See LICENSE for full terms.
