- Introduced new models in the Prisma schema for giveaways, tickets, self-role panels, starboard configurations, and suggestions, enhancing the bot's functionality. - Implemented job handling for self-role expiration and ticket management, improving user experience. - Updated command localization to support new features in both German and English. - Enhanced the job processing system to include dedicated workers for managing tickets and self-role expirations. - Documented the new features and their setup processes in PHASE-TRACKING.md for clarity on implementation steps.
221 lines
9.0 KiB
Markdown
221 lines
9.0 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.
|
||
|
||
## Phase 3 – Leveling, Economy, Utility, Fun (Status: implementiert, manuelle Tests ausstehend)
|
||
|
||
### Abgeschlossen
|
||
|
||
- Prisma-Migration `20260722150000_phase3_modules`:
|
||
- `LevelingConfig`, `MemberLevel`, `LevelReward`
|
||
- `EconomyConfig`, `MemberEconomy`, `ShopItem`, `InventoryItem`
|
||
- `Poll`, `PollVote`, `Reminder`, `AfkStatus`
|
||
- Shared-Helfer `packages/shared/src/phase3.ts` + Tests
|
||
- Commands und Events in Root verdrahtet (`commands.ts`, `index.ts`)
|
||
|
||
### Leveling (`apps/bot/src/modules/leveling/`)
|
||
|
||
- `/rank` (Canvas-Rankkarte), `/leaderboard`, `/xp give|remove|reset`
|
||
- Text-XP (Cooldown Redis) und Voice-XP
|
||
- Multiplikatoren, No-XP-Kanäle/-Rollen, Level-Rewards, Level-Up CHANNEL/DM/OFF
|
||
|
||
### Economy (`apps/bot/src/modules/economy/`)
|
||
|
||
- `/balance`, `/daily`, `/weekly`, `/work`, `/pay`
|
||
- `/gamble`, `/slots`, `/blackjack` (Buttons), `/coinflip` (Wette)
|
||
- `/shop view|buy`, `/inventory`, `/eco leaderboard|give|remove|reset`
|
||
- Währung pro Server in `EconomyConfig`
|
||
|
||
### Utility (`apps/bot/src/modules/utility/`)
|
||
|
||
- `/userinfo`, `/serverinfo`, `/roleinfo`, `/channelinfo`, `/avatar`, `/banner`
|
||
- `/poll create` (Buttons, DB, Ablauf via BullMQ)
|
||
- `/remindme`, `/reminders list|delete` (BullMQ)
|
||
- `/afk set`, `/emoji add|remove|steal`, `/sticker add`, `/timestamp`
|
||
- Context-Menu **Translate**, `/snipe`, `/editsnipe`, `/embed builder`
|
||
|
||
### Fun (`apps/bot/src/modules/fun/`)
|
||
|
||
- `/8ball`, `/dice`, `/flip` (freier Münzwurf; Economy behält `/coinflip`)
|
||
- `/rps`, `/choose`, `/trivia`, `/tictactoe`, `/connect4`, `/hangman`
|
||
- `/meme`, `/cat`, `/dog` (abschaltbar via Redis `fun:config:{guildId}`)
|
||
|
||
### Manuelle Discord-Tests (offen)
|
||
|
||
- Leveling: Nachrichten/Voice → XP, `/rank`, Level-Up, `/xp`
|
||
- Economy: Daily/Work, Shop, Blackjack-Buttons, `/eco give`
|
||
- Utility: Poll, Reminder, AFK, Snipe, Embed, Translate
|
||
- Fun: `/flip` vs `/coinflip`, Spiele, Medien-APIs
|
||
- Stack neu bauen: `docker compose up -d --build` (Migration anwenden)
|
||
|
||
## Nächster geplanter Schritt
|
||
|
||
- Manuelle Phase-3-Tests, dann nach Freigabe Phase 4 (Giveaways, Tickets, Reaction Roles, Custom Commands, Geburtstage, Temp-Voice).
|
||
|
||
### Starboard (`apps/bot/src/modules/starboard/`)
|
||
|
||
- `/starboard setup` (Kanal, Schwellenwert, Emoji, Self-Star)
|
||
- Reaktions-Events: Nachrichten mit genügend ⭐ (konfigurierbar) → Embed im Starboard-Kanal
|
||
- NSFW-/Bot-/Ignore-Kanal-Ausschluss, Self-Star-Regel, Eintrag in `StarboardEntry`
|
||
|
||
### Suggestions (`apps/bot/src/modules/suggestions/`)
|
||
|
||
- `/suggest`, `/suggestion setup|approve|deny|consider|implement`
|
||
- Upvote/Downvote-Buttons (`sug:vote:{id}:up|down`), optional Thread
|
||
- Status-Update mit Kanal-Verschiebung (approved/denied) und DM an Autor
|
||
|
||
### Manuelle Discord-Tests Starboard/Suggestions (offen)
|
||
|
||
- `/starboard setup`, Reaktionen bis/unter Schwellenwert, Self-Star aus/an
|
||
- `/suggestion setup`, `/suggest`, Voting, Staff-Status + DM
|
||
|
||
### Giveaways (`apps/bot/src/modules/giveaways/`)
|
||
|
||
- `/giveaway start|end|reroll|list|delete|pause`
|
||
- Button `gw:join:{giveawayId}`, BullMQ-Job `giveawayEnd` (Export: `endGiveaway`)
|
||
- Anforderungen: Rolle, Level, Mitgliedschaftsdauer; DM an Gewinner
|
||
|
||
### Tickets (`apps/bot/src/modules/tickets/`)
|
||
|
||
- `/ticket panel create`, `/ticket category create`, `/ticket close|claim|add|remove|rename|priority`
|
||
- Panel-Buttons/Select, Modal, Kanal-/Thread-Modus, HTML-Transkript, Bewertung, Auto-Close-Export
|
||
|
||
### Manuelle Discord-Tests Giveaways/Tickets (offen)
|
||
|
||
- Giveaway: Start, Join, Ende/Reroll/Pause; Ticket: Panel, Öffnen, Close, Transkript, Rating
|
||
- Wiring in `commands.ts`, `index.ts`, `jobs.ts` (Parent-Agent)
|
||
|