Feature 3: Devlog-Archiv — Live-Listener + /devlog-backfill
- Webhook-Nachrichten im Devlog-Kanal werden automatisch in SQLite archiviert (devlog.py im EcoGame-Repo bleibt unverändert) - /devlog-backfill (Admin): scannt die komplette Kanal-Historie in 100er-Blöcken - Dedupe über Discord-Message-ID, Embeds werden mit Titel+Beschreibung erfasst - Neue Intents: GuildMessages + MessageContent, neue Env-Var DEVLOG_CHANNEL_ID Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ Discord-Bot + Webinterface für die EcoGame-Community.
|
||||
**Features (Roadmap):**
|
||||
1. ✅ Bot online + `/ping` Slash-Command
|
||||
2. ✅ Commit-Feed: Gitea-Push-Webhooks → Discord-Embeds + SQLite-Archiv
|
||||
3. ⬜ Devlog-Archiv: tägliche Devlogs archivieren
|
||||
3. ✅ Devlog-Archiv: Devlog-Kanal live archivieren + `/devlog-backfill` für die Historie
|
||||
4. ⬜ Webinterface: Discord-Login, Devlog- & Commit-Seiten
|
||||
|
||||
**Stack:** Node.js 20+, discord.js v14, Fastify, React (ab Feature 4), SQLite (better-sqlite3), Docker
|
||||
@@ -97,6 +97,25 @@ derselben Commits erzeugt keine doppelten DB-Einträge.
|
||||
|
||||
---
|
||||
|
||||
## Setup: Devlog-Archiv
|
||||
|
||||
`tools/devlog.py` (EcoGame-Repo) postet weiterhin unverändert per Discord-Webhook
|
||||
in den Devlog-Kanal — der Bot liest dort mit und archiviert jede Webhook-Nachricht
|
||||
in SQLite (User-Chatter im Kanal wird ignoriert).
|
||||
|
||||
1. **Message Content Intent** muss im
|
||||
[Developer Portal](https://discord.com/developers/applications) unter **Bot**
|
||||
aktiviert sein (steht oben schon im Setup — kurz prüfen)
|
||||
2. `.env` / Portainer-Stack: `DEVLOG_CHANNEL_ID` = Kanal-ID des Devlog-Kanals
|
||||
3. Bot neu starten → ab jetzt wird jedes neue Devlog automatisch archiviert
|
||||
4. Einmalig in Discord: **`/devlog-backfill`** (Admin only) — scannt die komplette
|
||||
Kanal-Historie und archiviert alle bisherigen Devlogs nach
|
||||
|
||||
Dedupe läuft über die Discord-Message-ID — Backfill und Live-Listener
|
||||
können sich nicht doppeln, der Command ist beliebig oft wiederholbar.
|
||||
|
||||
---
|
||||
|
||||
## Lokal starten (Entwicklung)
|
||||
|
||||
```
|
||||
@@ -162,10 +181,12 @@ ecobot/
|
||||
│ ├── config.js # Env-Konfiguration mit Validierung
|
||||
│ ├── db.js # SQLite (better-sqlite3), Schema + Queries
|
||||
│ ├── bot/
|
||||
│ │ ├── client.js # Discord-Client, Command-Registry, Interactions
|
||||
│ │ ├── client.js # Discord-Client, Command-Registry, Interactions, Devlog-Listener
|
||||
│ │ ├── commit-feed.js # Push → Discord-Embed
|
||||
│ │ ├── devlog-archive.js # Webhook-Nachricht → SQLite
|
||||
│ │ └── commands/
|
||||
│ │ └── ping.js # /ping — Lebenszeichen
|
||||
│ │ ├── ping.js # /ping — Lebenszeichen
|
||||
│ │ └── devlog-backfill.js # /devlog-backfill — Historie archivieren (Admin)
|
||||
│ └── web/
|
||||
│ └── server.js # Fastify: /health, /webhooks/gitea (HMAC-geprüft)
|
||||
├── .env.example # Vorlage für Secrets (nach .env kopieren)
|
||||
|
||||
Reference in New Issue
Block a user