- Implemented AutoMod capabilities including spam filtering, anti-raid, and anti-nuke actions. - Added Logging module to track moderation actions and events across the bot. - Introduced Welcome module for customizable welcome messages and autoroles. - Developed Verification system with captcha and role assignment features. - Updated Prisma schema to include new models for AutoMod, Logging, Welcome, and Verification. - Enhanced command localization for new features in both German and English. - Improved health server to handle captcha verification requests. - Added new environment variable for public base URL to support captcha links.
141 lines
5.9 KiB
Markdown
141 lines
5.9 KiB
Markdown
# Nexumi – Phasen-Tracking
|
||
|
||
|
||
|
||
Dieses Dokument hält den aktuellen Implementierungsstand fest. Es wird bei jedem Arbeitsfortschritt aktualisiert.
|
||
|
||
|
||
|
||
## Assets
|
||
|
||
|
||
|
||
- Bot-Logo vorhanden: `docs/logo/nexumi-logo.svg`
|
||
|
||
|
||
|
||
## Phase 1 – Fundament (Status: abgeschlossen, manuelle Discord-Tests ausstehend)
|
||
|
||
|
||
|
||
### Bereits abgeschlossen
|
||
|
||
|
||
|
||
- Monorepo-Basis mit Workspaces:
|
||
|
||
- `apps/bot`
|
||
|
||
- `packages/shared`
|
||
|
||
- Basis-Tooling:
|
||
|
||
- TypeScript strict
|
||
|
||
- ESLint
|
||
|
||
- Prettier
|
||
|
||
- Vitest
|
||
|
||
- Turbo
|
||
|
||
- Docker-Compose-Grundstack:
|
||
|
||
- `postgres` mit Healthcheck
|
||
|
||
- `redis` mit Healthcheck
|
||
|
||
- `bot`
|
||
|
||
- `webui`-Scaffold-Service (temporär)
|
||
|
||
- `backups` Volume angebunden
|
||
|
||
- Prisma-Grundmodell inkl. Moderationsdaten:
|
||
|
||
- `Guild`
|
||
|
||
- `GuildSettings`
|
||
|
||
- `User`
|
||
|
||
- `Case`
|
||
|
||
- `Warning`
|
||
|
||
- `ModNote`
|
||
|
||
- `EscalationRule`
|
||
|
||
- Bot-Grundarchitektur:
|
||
|
||
- Sharding-Startpfad
|
||
|
||
- Command-Registrierung
|
||
|
||
- Command-Routing
|
||
|
||
- zentraler Permission-Check
|
||
|
||
- Basis-i18n in `@nexumi/shared`
|
||
|
||
- Guild-Locale-Auflösung über DB-Settings mit Fallback auf Env-Default
|
||
|
||
- Health-Endpoint (`/health`) und token-geschütztes `/metrics`-Scaffold
|
||
|
||
- BullMQ-Integration:
|
||
|
||
- Moderation-Queue
|
||
|
||
- Temp-Ban-Expire-Job
|
||
|
||
- täglicher Backup-Job (`pg_dump`)
|
||
|
||
- Backup-Retention-Cleanup
|
||
|
||
- Moderation als Referenzmodul (implementiert):
|
||
|
||
- `/ban`, `/unban`, `/kick`, `/timeout`, `/untimeout`
|
||
|
||
- `/warn add|list|remove|clear`
|
||
|
||
- `/warn escalation-set|escalation-list|escalation-remove`
|
||
|
||
- `/purge` (Filter: User, Bots, Links, Attachments, Regex)
|
||
|
||
- `/slowmode`, `/lock`, `/unlock`
|
||
|
||
- `/nick set|reset`
|
||
|
||
- `/case view|edit|delete`
|
||
|
||
- `/modnote add|list`
|
||
|
||
- user-facing Reply-Strings im Moderationsfluss auf i18n-Keys umgestellt (`de`/`en`)
|
||
|
||
- Slash-Command-Beschreibungen und Optionstexte lokalisiert (`de` + `en-US` via Discord-Localizations)
|
||
|
||
- Bestätigungsflow für destruktive Aktionen (`/ban`, `/purge`, `/case delete`) mit Buttons
|
||
|
||
- standardisierte Case-Audit-Metadaten über `@nexumi/shared` (`buildCaseMetadata`)
|
||
|
||
- Docker-Build/Runtime-Fixes für E2E:
|
||
|
||
- `.dockerignore` ergänzt
|
||
|
||
- Prisma-Migration beim Bot-Start (`prisma migrate deploy`)
|
||
|
||
- Bot-Healthcheck auf `/health`
|
||
|
||
- E2E-Verifikation (automatisiert, lokal):
|
||
|
||
- `docker compose up -d --build` erfolgreich
|
||
|
||
- Postgres/Redis healthy
|
||
|
||
- Migration `20260722123000_init` angewendet
|
||
|
||
- Bot online (`Nexumi#9122`), 13 Slash-Commands registriert
|
||
|
||
- Bot-Container healthy
|
||
|
||
- Tests (aktuell vorhanden):
|
||
|
||
- `packages/shared/src/i18n.test.ts`
|
||
|
||
- `packages/shared/src/audit.test.ts`
|
||
|
||
- `apps/bot/src/modules/moderation/duration.test.ts`
|
||
|
||
|
||
|
||
### Manuelle Discord-Tests (noch offen)
|
||
|
||
|
||
|
||
- Bot auf Test-Server einladen (falls noch nicht geschehen)
|
||
|
||
- Slash-Commands testen: `/ban`, `/warn add`, `/purge`, `/case view`
|
||
|
||
- Bestätigungsbuttons bei `/ban` und `/purge` prüfen
|
||
|
||
|
||
|
||
## Phase 2 – AutoMod, Logging, Welcome, Verifizierung (Status: implementiert, manuelle Tests ausstehend)
|
||
|
||
|
||
|
||
### Abgeschlossen
|
||
|
||
|
||
|
||
- Prisma-Erweiterung + Migration `20260722140000_phase2_modules`:
|
||
|
||
- `AutoModConfig`, `AutoModRule`
|
||
|
||
- `LoggingConfig`, `LogChannel`
|
||
|
||
- `WelcomeConfig`
|
||
|
||
- `VerificationConfig`
|
||
|
||
- Shared-Schemas und Hilfsfunktionen (`packages/shared/src/phase2.ts`)
|
||
|
||
- **AutoMod** (`apps/bot/src/modules/automod/`):
|
||
|
||
- Filter: Spam, Massen-Mentions, Caps, Invite-Links, externe Links, Wortfilter, Duplikate, Emoji-Spam, Zalgo, Phishing-Blockliste
|
||
|
||
- Standardregeln werden pro Guild beim ersten Zugriff angelegt
|
||
|
||
- Anti-Raid (Join-Rate → Lockdown)
|
||
|
||
- Anti-Nuke (Massen-Bans/Channel-Löschungen → Rechteentzug)
|
||
|
||
- `/automod status`
|
||
|
||
- Phishing-Listen-Refresh via BullMQ (alle 6h + beim Start)
|
||
|
||
- **Logging** (`apps/bot/src/modules/logging/`):
|
||
|
||
- Event-Handler für alle SPEC-Events (Nachrichten, Member, Bans, Rollen, Kanäle, Voice, Invites, Emoji/Sticker, Threads, Guild-Update)
|
||
|
||
- Mod-Action-Log verknüpft mit Case-System (`logModAction` in `createCase`)
|
||
|
||
- Ignore-Listen (Kanäle, Rollen, Bots) über DB
|
||
|
||
- Log-Kanal-Zuordnung über `LogChannel`-Tabelle (Konfiguration künftig WebUI)
|
||
|
||
- **Welcome/Leave** (`apps/bot/src/modules/welcome/`):
|
||
|
||
- Text-, Embed- und Bild-Karten (Canvas via `@napi-rs/canvas`)
|
||
|
||
- Platzhalter-System
|
||
|
||
- Autoroles (User/Bots getrennt)
|
||
|
||
- Welcome-DM
|
||
|
||
- `/welcome test`, `/welcome preview`
|
||
|
||
- **Verifizierung** (`apps/bot/src/modules/verification/`):
|
||
|
||
- `/verify setup`, `/verify panel`
|
||
|
||
- Button-Verify und Captcha-Verify (Captcha-Seite unter `/verify/captcha` am Health-Server)
|
||
|
||
- Mindest-Accountalter, Fehlschlag-Aktionen (Kick/Ban/None)
|
||
|
||
- Unverified-Rolle bei Join
|
||
|
||
- Bot-Intents erweitert:
|
||
|
||
- `GuildMembers`, `GuildMessages`, `MessageContent`, `GuildModeration`, `GuildVoiceStates`, `GuildEmojisAndStickers`, `GuildInvites`
|
||
|
||
- Neue Env-Variable: `PUBLIC_BASE_URL` (Captcha-Links)
|
||
|
||
- Tests: `packages/shared/src/phase2.test.ts`
|
||
|
||
|
||
|
||
### Manuelle Discord-Tests (noch offen)
|
||
|
||
|
||
|
||
- **Privileged Intents** im Developer Portal aktivieren:
|
||
|
||
- `SERVER MEMBERS INTENT`
|
||
|
||
- `MESSAGE CONTENT INTENT`
|
||
|
||
- AutoMod: Spam-/Invite-Testnachrichten senden
|
||
|
||
- `/automod status` prüfen
|
||
|
||
- Logging: Log-Kanäle per DB/ später WebUI setzen, Events auslösen
|
||
|
||
- `/welcome preview` und `/welcome test` (Konfiguration zunächst per DB oder später WebUI)
|
||
|
||
- `/verify setup` + `/verify panel`, Button- und Captcha-Flow testen
|
||
|
||
- `PUBLIC_BASE_URL` auf erreichbare URL setzen (für Captcha außerhalb localhost)
|
||
|
||
|
||
|
||
### Hinweise
|
||
|
||
|
||
|
||
- Welcome-/Logging-Konfiguration erfolgt in Phase 2 über die Datenbank; die WebUI-Editoren kommen in Phase 7.
|
||
|
||
- Captcha-Seite läuft am Bot-Health-Port (`HEALTH_PORT`); in Produktion muss `PUBLIC_BASE_URL` darauf zeigen oder über Reverse-Proxy geroutet werden.
|
||
|
||
|
||
|
||
## Nächster geplanter Schritt
|
||
|
||
|
||
|
||
- Manuelle Phase-2-Tests auf Test-Server, dann nach Freigabe Phase 3 (Leveling, Economy, Utility, Fun).
|
||
|