Implement confirmation flow for destructive moderation actions
- Added confirmation prompts for destructive commands such as `/ban`, `/purge`, and `/case delete` to enhance user safety. - Integrated locale support for confirmation messages, ensuring clarity in both German and English. - Refactored command logic to utilize the new confirmation system, improving user experience and reducing accidental actions.
This commit is contained in:
@@ -37,6 +37,7 @@ const de: Dictionary = {
|
||||
'generic.guildOnly': 'Dieser Command kann nur auf einem Server verwendet werden.',
|
||||
'generic.botMissingPermission': 'Dem Bot fehlt die erforderliche Berechtigung ({permission}).',
|
||||
'generic.invalidRegex': 'Ungültiges Regex-Muster.',
|
||||
'generic.error': 'Es ist ein Fehler aufgetreten.',
|
||||
'moderation.success': 'Aktion erfolgreich ausgeführt.',
|
||||
'moderation.reason.none': 'Kein Grund angegeben',
|
||||
'moderation.warning.created': 'Verwarnung erstellt: {warningId}',
|
||||
@@ -50,13 +51,24 @@ const de: Dictionary = {
|
||||
'moderation.escalation.saved':
|
||||
'Eskalationsregel gespeichert: {warnCount} Verwarnungen => {action}{duration}.',
|
||||
'moderation.escalation.removed':
|
||||
'Eskalationsregel für {warnCount} Verwarnungen entfernt.'
|
||||
'Eskalationsregel für {warnCount} Verwarnungen entfernt.',
|
||||
'moderation.confirm.button.confirm': 'Bestätigen',
|
||||
'moderation.confirm.button.cancel': 'Abbrechen',
|
||||
'moderation.confirm.permanent': 'dauerhaft',
|
||||
'moderation.confirm.ban':
|
||||
'Ban bestätigen für <@{userId}>?\nGrund: {reason}\nDauer: {duration}',
|
||||
'moderation.confirm.purge': '{amount} Nachrichten löschen? Diese Aktion kann nicht rückgängig gemacht werden.',
|
||||
'moderation.confirm.caseDelete': 'Fall #{caseNumber} wirklich löschen?',
|
||||
'moderation.confirm.expired': 'Bestätigung abgelaufen. Bitte den Befehl erneut ausführen.',
|
||||
'moderation.confirm.cancelled': 'Aktion abgebrochen.',
|
||||
'moderation.confirm.unauthorized': 'Nur der ausführende Moderator kann diese Bestätigung nutzen.'
|
||||
};
|
||||
const en: Dictionary = {
|
||||
'generic.noPermission': 'You do not have permission for this action.',
|
||||
'generic.guildOnly': 'This command can only be used in a server.',
|
||||
'generic.botMissingPermission': 'Bot lacks required permission ({permission}).',
|
||||
'generic.invalidRegex': 'Invalid regex pattern.',
|
||||
'generic.error': 'An error occurred.',
|
||||
'moderation.success': 'Action executed successfully.',
|
||||
'moderation.reason.none': 'No reason provided',
|
||||
'moderation.warning.created': 'Warning created: {warningId}',
|
||||
@@ -68,7 +80,18 @@ const en: Dictionary = {
|
||||
'moderation.escalation.noneConfigured': 'No escalation rules configured.',
|
||||
'moderation.escalation.saved':
|
||||
'Escalation rule saved: {warnCount} warnings => {action}{duration}.',
|
||||
'moderation.escalation.removed': 'Escalation rule removed for {warnCount} warnings.'
|
||||
'moderation.escalation.removed': 'Escalation rule removed for {warnCount} warnings.',
|
||||
'moderation.confirm.button.confirm': 'Confirm',
|
||||
'moderation.confirm.button.cancel': 'Cancel',
|
||||
'moderation.confirm.permanent': 'permanent',
|
||||
'moderation.confirm.ban':
|
||||
'Confirm ban for <@{userId}>?\nReason: {reason}\nDuration: {duration}',
|
||||
'moderation.confirm.purge':
|
||||
'Delete {amount} messages? This action cannot be undone.',
|
||||
'moderation.confirm.caseDelete': 'Really delete case #{caseNumber}?',
|
||||
'moderation.confirm.expired': 'Confirmation expired. Please run the command again.',
|
||||
'moderation.confirm.cancelled': 'Action cancelled.',
|
||||
'moderation.confirm.unauthorized': 'Only the moderator who started this action can confirm it.'
|
||||
};
|
||||
|
||||
const locales: Record<Locale, Dictionary> = { de, en };
|
||||
|
||||
Reference in New Issue
Block a user