Discord anti-raid and anti-spam bot — open-core model.
| Package | License | Description |
|---|---|---|
packages/core |
MIT | Core bot: detection pipeline, moderation commands, i18n |
packages/premium |
BSL 1.1 | Advanced raid detection, appeal system, analytics |
- Spam Detection — blocks message floods (configurable rate/window per guild)
- Duplicate Detection — catches repeated identical messages
- Mention Abuse — flags @everyone/@here and mass-mention messages
- Link Spam — rate-limits URL posting
- Invite Detection — blocks Discord invite links (per-guild whitelist)
- Word Filter — plain-string and regex patterns (up to 50 per guild)
- Point-based Actions — automatic WARN → MUTE → KICK → BAN escalation with decay
- Moderation Commands —
/warn/mute/unmute/kick/ban/unban/history - Interactive Settings UI — configure everything via
/settings - Infraction History — paginated per-user audit log
- i18n — English and Japanese; more languages via PRs
- Exempt Roles — exclude moderator roles from detection
- Advanced Raid Detection — coordinated join surge detection
- Appeal System — user-facing ban/mute appeal workflow
- Analytics — infraction trends and detector hit-rate charts
- Multi-server Sync — shared blocklists and banlists across owned servers
- Unlimited word filter patterns, punishment thresholds, and exempt roles
| Requirement | Version |
|---|---|
| Node.js | ≥ 20 |
| pnpm | ≥ 9 |
| PostgreSQL | ≥ 15 |
git clone https://github.com/your-org/disumprevies.git
cd disumpreviespnpm installcp .env.example .envEdit .env:
# Discord application credentials (from https://discord.com/developers/applications)
DISCORD_TOKEN=your_bot_token_here
DISCORD_CLIENT_ID=your_application_id_here
# PostgreSQL connection string
DATABASE_URL=postgresql://user:password@localhost:5432/disumprevies
# Optional
LOG_LEVEL=info # debug | info | warn | error (default: info)
NODE_ENV=production # development | production (default: development)# Generate the Prisma client
pnpm prisma:generate
# Run database migrations
pnpm prisma:migratepnpm buildRegister commands with Discord (required once, and again after adding new commands):
# Deploy to a specific guild (instant, for testing)
GUILD_ID=your_guild_id node packages/core/dist/commands/deploy.js
# Deploy globally (up to 1 hour propagation)
node packages/core/dist/commands/deploy.js --globalnode packages/core/dist/bot/index.jsFor development with hot-reload:
pnpm devcp .env.example .env
# Edit .env with your Discord credentials
docker compose up -dThis starts:
bot— the Disumprevies bot containerdb— PostgreSQL 16
Migrations run automatically on startup.
docker build -t disumprevies .
docker run --env-file .env disumpreviesGenerate an invite URL from the Discord Developer Portal:
- Open your application → OAuth2 → URL Generator
- Select scopes:
bot,applications.commands - Select bot permissions:
- Manage Messages
- Moderate Members (timeout)
- Kick Members
- Ban Members
- View Channels
- Send Messages
- Read Message History
- Embed Links
- Copy the generated URL and share it with server administrators
Required permission integer: 1099511696384
Contributions are welcome. Please follow the guidelines below.
pnpm install
pnpm build
pnpm test# All tests
pnpm test
# Single file
pnpm --filter @disumprevies/core test -- src/detectors/__tests__/spam.test.ts
# With coverage
pnpm --filter @disumprevies/core exec vitest run --coverage- No
anytype — useunknownand narrow with type guards - No hardcoded IDs or secrets — use
src/config.tsand environment variables - All user-facing strings through i18n — use
t(guildId, key)ortSync(key) - Each detector is a single file in
src/detectors/implementing theDetectorinterface - Each slash command is a single file in
src/commands/ - Conventional commits:
feat:,fix:,refactor:,test:,docs:,chore: - Branch naming:
feat/xxx,fix/xxx,refactor/xxx
- Create
packages/core/src/detectors/myDetector.tsimplementingDetector - Write unit tests in
packages/core/src/detectors/__tests__/myDetector.test.ts - Register the detector in
packages/core/src/events/messageCreate.ts - Add settings keys to
GuildSettingsinsrc/settings/types.ts - Add i18n keys to
locales/en/messages.jsonandlocales/ja/messages.json - Update
docs/SPEC.md
See locales/CONTRIBUTING.md for the full guide.
-
pnpm buildpasses -
pnpm testpasses (no regressions) - New i18n keys added for all user-facing strings
- Docs updated if behaviour changed
packages/
core/ — MIT-licensed bot (main entry point)
premium/ — BSL-licensed premium features
locales/
en/messages.json — English translations
ja/messages.json — Japanese translations
docs/
SPEC.md — Full requirements specification
DATABASE.md — Schema design and index strategy
PREMIUM.md — Free vs premium matrix and pricing
| Component | License |
|---|---|
packages/core |
MIT |
packages/premium |
Business Source License 1.1 |
Open-core model: The core bot is fully MIT — free to use, modify, and self-host without restriction. The premium package is BSL 1.1; it converts to MIT 4 years after each release. Commercial use of the premium package requires a separate license.