refactor(ui): give every message one friendly, ungendered voice
Members read all replies as one voice, so the wording now lives in one place:
the shared titles, the list marker and the "what to do next" hint come from
src/ui/embeds.js, and every module follows them.
An error explains the cause, recalls the rule and offers the way out instead of
blaming; a success says what happens next. Nothing agrees on the gender of a
person ("utilisateur", "cher/chère", "ravie"), which also keeps the sentences
shorter. Two tests lock the shared titles and reject gendered descriptions.
This commit is contained in:
31 files changed
+469
-201
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { Events, MessageFlags } from 'discord.js';
|
||||
import { ACCESS_LABELS } from '../config/constants.js';
|
||||
import { PermissionDeniedError, UserFacingError } from '../core/errors.js';
|
||||
import { createLogger } from '../core/logger.js';
|
||||
import { hasAccess } from '../core/permissions.js';
|
||||
@@ -37,7 +38,9 @@ async function runChatInputCommand(interaction) {
|
||||
const subcommand = interaction.options.getSubcommand(false);
|
||||
const requiredLevel = command.subcommandAccess?.[subcommand] ?? command.access;
|
||||
if (!hasAccess(interaction.member, requiredLevel)) {
|
||||
throw new PermissionDeniedError();
|
||||
throw new PermissionDeniedError(
|
||||
`Cette commande demande le niveau **${ACCESS_LABELS[requiredLevel]}**. Si tu en as besoin, demande à une personne du staff : elle peut le faire pour toi.`,
|
||||
);
|
||||
}
|
||||
await command.execute(interaction);
|
||||
}
|
||||
@@ -77,6 +80,9 @@ export async function execute(_client, interaction) {
|
||||
}
|
||||
|
||||
log.error(`Interaction failed: ${interaction.commandName ?? interaction.customId ?? 'unknown'}`, error);
|
||||
await replyError(interaction, 'Une erreur inattendue est survenue. Réessaie plus tard.').catch(() => {});
|
||||
await replyError(
|
||||
interaction,
|
||||
'Quelque chose s’est mal passé de mon côté, rien n’est perdu. Réessaie dans un instant — je l’ai noté dans mes logs, l’équipe pourra regarder si ça recommence.',
|
||||
).catch(() => {});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user