Implement leave announcement for banned members and enhance moderation notifications

- Added a `leaveAnnounceBan` field to the `WelcomeConfig` model, allowing for optional announcements in the leave channel when a member is banned.
- Updated the leave handling logic to check for bans and send a notice in the leave channel if the `leaveAnnounceBan` toggle is enabled.
- Enhanced moderation actions (kick and ban) to notify the affected user via DM with the reason for the action.
- Introduced a new `notifyModerationTargetDm` function to streamline DM notifications for moderation actions.
- Updated the WebUI to include a toggle for the `leaveAnnounceBan` feature, improving user configurability.
- Improved localization for new messages related to moderation notifications and leave announcements in both English and German.
- Documented changes in phase tracking to reflect the new leave announcement feature and moderation notification enhancements.
This commit is contained in:
TheOnlyMace
2026-07-25 17:50:18 +02:00
parent 03bb406d82
commit e2bab9cceb
16 changed files with 198 additions and 5 deletions

View File

@@ -254,6 +254,7 @@ export const WelcomeConfigDashboardSchema = z.object({
leaveContent: z.string().max(2000).nullable().optional(),
leaveEmbed: DashboardEmbedSchema.nullable().optional(),
leaveComponents: MessageComponentsV2Schema.nullable().optional(),
leaveAnnounceBan: z.boolean().default(false),
welcomeDmEnabled: z.boolean(),
welcomeDmContent: z.string().max(2000).nullable().optional(),
userAutoroleIds: z.array(z.string()),

View File

@@ -139,6 +139,11 @@ const de: Dictionary = {
'moderation.warning.notFound': 'Verwarnung nicht gefunden.',
'moderation.warning.dm':
'Du hast eine Verwarnung auf **{guild}** erhalten.\nGrund: {reason}\nVerwarnungen: {count} (Nr. #{warningNumber})',
'moderation.kick.dm': 'Du wurdest von **{guild}** gekickt.\nGrund: {reason}',
'moderation.ban.dm': 'Du wurdest von **{guild}** gebannt.\nGrund: {reason}',
'moderation.ban.dm.temporary':
'Du wurdest von **{guild}** temporär gebannt ({duration}).\nGrund: {reason}',
'welcome.leave.bannedNotice': '**{user}** wurde gebannt.\nGrund: {reason}',
'moderation.purge.done': '{deletedCount} Nachrichten gelöscht (Fall #{caseNumber}).',
'moderation.note.none': 'Keine Notizen vorhanden.',
'moderation.case.notFound': 'Fall nicht gefunden.',
@@ -758,6 +763,11 @@ const en: Dictionary = {
'moderation.warning.notFound': 'Warning not found.',
'moderation.warning.dm':
'You received a warning on **{guild}**.\nReason: {reason}\nWarnings: {count} (No. #{warningNumber})',
'moderation.kick.dm': 'You were kicked from **{guild}**.\nReason: {reason}',
'moderation.ban.dm': 'You were banned from **{guild}**.\nReason: {reason}',
'moderation.ban.dm.temporary':
'You were temporarily banned from **{guild}** ({duration}).\nReason: {reason}',
'welcome.leave.bannedNotice': '**{user}** was banned.\nReason: {reason}',
'moderation.purge.done': 'Deleted {deletedCount} messages (case #{caseNumber}).',
'moderation.note.none': 'No notes.',
'moderation.case.notFound': 'Case not found.',