Setup-Seite: Kanal-Auswahl, Feed-Regeln und Status im Webinterface
- Settings-Tabelle in SQLite; Env-Variablen nur noch Fallback, Änderungen greifen sofort - /settings (Admin): Devlog-/Commit-Kanal als Dropdown aus allen sichtbaren Textkanälen, je mit Test-senden-Button - Commit-Feed-Regeln: an/aus, Branch-Filter, ignorierte Repos (archiviert wird immer, gefiltert wird nur das Posten; ignorierte Repos komplett übersprungen) - Status-Panel: Bot-Tag, Uptime, Devlog-/Commit-Zahlen, DB-Größe - API: GET/PUT /api/settings, POST /api/settings/test/:target (alles Admin-only) - COMMIT_CHANNEL_ID/DEVLOG_CHANNEL_ID in config optional Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import { join } from 'node:path';
|
||||
import { AttachmentBuilder, EmbedBuilder } from 'discord.js';
|
||||
import { config } from '../config.js';
|
||||
import { saveDevlog } from '../db.js';
|
||||
import { devlogChannelId } from '../runtime-settings.js';
|
||||
import { imagesDir } from '../bot/devlog-archive.js';
|
||||
|
||||
const BRAND_YELLOW = 0xf5c518;
|
||||
@@ -64,7 +65,11 @@ export function registerDevlogEndpoint(app, client) {
|
||||
return reply.code(400).send({ error: 'empty devlog' });
|
||||
}
|
||||
|
||||
const channel = await client.channels.fetch(config.devlogChannelId);
|
||||
const targetChannel = devlogChannelId();
|
||||
if (!targetChannel) {
|
||||
return reply.code(500).send({ error: 'no devlog channel configured' });
|
||||
}
|
||||
const channel = await client.channels.fetch(targetChannel);
|
||||
if (!channel?.isTextBased()) {
|
||||
return reply.code(500).send({ error: 'devlog channel not found' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user