Enhance bot command handling with new leveling, economy, and utility features

- Integrated leveling and economy commands, including XP management and shop interactions.
- Added context menu support for utility commands, improving user interaction options.
- Updated command registration to include new commands and context menus, enhancing overall functionality.
- Improved logging to track the registration of commands and context menus.
- Refactored interaction handling to accommodate new command types and ensure smooth execution.
This commit is contained in:
smueller
2026-07-22 12:56:00 +02:00
parent fa5910ec43
commit 58623bd1d3
8 changed files with 140 additions and 43 deletions

View File

@@ -135,48 +135,53 @@ Dieses Dokument hält den aktuellen Implementierungsstand fest. Es wird bei jede
- 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: in Arbeit)
## Phase 3 Leveling, Economy, Utility, Fun (Status: implementiert, manuelle Tests ausstehend)
### Utility (`apps/bot/src/modules/utility/`) implementiert
### Abgeschlossen
- Info-Commands: `/userinfo`, `/serverinfo`, `/roleinfo`, `/channelinfo`, `/avatar`, `/banner`
- `/poll create` mit Buttons, DB (`Poll`/`PollVote`), optionaler Ablauf via BullMQ (`pollClose`)
- `/remindme`, `/reminders list|delete` mit BullMQ (`reminderSend`)
- `/afk set` mit Auto-Clear und Mention-Antwort
- `/emoji add|remove|steal`, `/sticker add`
- `/timestamp`, Context-Menu **Translate** (MyMemory API)
- `/snipe`, `/editsnipe` (Redis, TTL 1 h, Datenschutz-Hinweis)
- `/embed builder` (Modal)
- Queue: `reminderQueue` in `queues.ts`, Worker in `jobs.ts`
- i18n-Keys in `@nexumi/shared` (de/en) + `command-locales.ts`
- **Manuelles Wiring durch Parent noch nötig** (siehe Modul-README / Agent-Anweisung): Commands, Context-Menüs, Events, Interaction-Handler in `index.ts`/`commands.ts`
- 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`)
### Fun & Games (`apps/bot/src/modules/fun/`) implementiert
### Leveling (`apps/bot/src/modules/leveling/`)
- Einfache Commands: `/8ball`, `/dice`, `/flip` (nicht `/coinflip` Economy), `/rps`, `/choose`
- Button-Spiele: `/trivia`, `/tictactoe`, `/connect4`, `/hangman` (Redis-Spielzustand, TTL)
- Medien: `/meme`, `/cat`, `/dog` (API-Fetch; abschaltbar via Redis `fun:config:{guildId}``{mediaEnabled}`)
- Exports für Wiring: `funCommands`, `isFunButton`, `handleFunButton` aus `index.ts`
- i18n-Keys + Command-Locales in `@nexumi/shared` (de/en)
- **Manuelles Wiring durch Parent noch nötig**: `funCommands` in `commands.ts`, `isFunButton`/`handleFunButton` in `index.ts`
- `/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
### Manuelle Discord-Tests Fun (offen)
### Economy (`apps/bot/src/modules/economy/`)
- `/flip` vs. Economy `/coinflip` (kein Namenskonflikt)
- Trivia: nur Initiator kann antworten, Ablauf nach 2 min
- Tic-Tac-Toe / Connect 4: Züge nur für Teilnehmer, ephemerale Fehler
- Hangman: Buchstaben-Buttons, Gewinn/Verlust
- `/meme`, `/cat`, `/dog`; Medien deaktivieren via Redis-Config testen
- `/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`
### Manuelle Discord-Tests Utility (offen)
### Utility (`apps/bot/src/modules/utility/`)
- Poll mit/ohne Dauer, Mehrfachauswahl, anonym
- Reminder einmalig und mit Cron
- AFK setzen, erwähnen, zurückschreiben
- Snipe nach Löschen/Bearbeiten
- Embed-Builder-Modal
- Translate Context-Menu auf Nachricht
- `/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
- Utility- und Fun-Wiring abschließen, dann Leveling/Economy/Fun manuell testen; Phase-3-Freigabe nach grünem Build/Lint/Tests.
- Manuelle Phase-3-Tests, dann nach Freigabe Phase 4 (Giveaways, Tickets, Reaction Roles, Custom Commands, Starboard, Suggestions, Geburtstage, Temp-Voice).