feat(settings): make the server settings real, and widen them

The dashboard offered seven switches that nothing read: they promised a
behaviour the bot did not have, which is worse than offering nothing.

Every setting is now declared once, with its type, its bounds and its
explanation, and the services read it: the welcome message and its wording,
the automatic role, departure notices, the private notice sent to a
sanctioned member, the default mute duration, how much history a ban erases,
whether a closed ticket is deleted or archived, and an optional role mention
on the Gitea notifications.

A test walks the sources and fails when a declared key is read nowhere, so
the list cannot drift back into decoration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
nocodeandClaude Opus 5 committed 2026-09-23 22:31:36 +02:00
1 parent d439b1b3e8
commit 52a5c50692
13 files changed
+576 -146

No files matched your search

@@ -1,4 +1,5 @@
import { env } from '../../config/env.js';
import { readSetting } from '../../config/guild-settings.js';
import { createLogger } from '../../core/logger.js';
import { getNotificationChannel } from '../../database/repositories/notification-repository.js';
import { errorEmbed } from '../../ui/embeds.js';
@@ -58,7 +59,15 @@ export async function notify(client, type, payload) {
log.warn(`Notification channel unavailable for ${type}`, { channelId });
return null;
}
return channel.send(payload);
// An optional ping, prepended rather than replacing whatever content the
// caller already prepared.
const mention = readSetting('notifications.mentionRoleId');
const message = mention
? { ...payload, content: payload.content ? `<@&${mention}> ${payload.content}` : `<@&${mention}>` }
: payload;
return channel.send(message);
}
/** Reports an unexpected failure in the technical channel (M9-T07). */