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
+40
-4
@@ -1,6 +1,25 @@
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import { BOT_NAME, COLORS } from '../config/constants.js';
|
||||
|
||||
/**
|
||||
* Bot voice — one tone everywhere (M12-T02). Every user-facing string in the project follows
|
||||
* these rules, so the messages stay consistent as commands are added:
|
||||
*
|
||||
* - Informal French, short sentences, active voice; never a reproach or irony.
|
||||
* - The title states the outcome, the description says what to do next.
|
||||
* - One emoji per title, never decorative inside the body.
|
||||
* - No gendered agreement on a person: "tu es propriétaire", "ce membre", "l'équipe",
|
||||
* "la personne" — never "il / elle", "cher / chère", "ravi·e".
|
||||
* - An error explains the cause, recalls the rule and offers the way out.
|
||||
* - Same vocabulary across modules: équipe, membre, salon, ticket, motif.
|
||||
*/
|
||||
export const TONE = Object.freeze({
|
||||
success: '✅ C’est fait',
|
||||
error: '❌ Oups',
|
||||
warning: '⚠️ Attention',
|
||||
advice: '💡 Bon à savoir',
|
||||
});
|
||||
|
||||
/** Base embed with the shared FWS-Bot visual identity (M12-T02). */
|
||||
export function baseEmbed(color = COLORS.primary) {
|
||||
return new EmbedBuilder().setColor(color).setFooter({ text: BOT_NAME }).setTimestamp();
|
||||
@@ -10,10 +29,27 @@ export function infoEmbed(title, description) {
|
||||
return baseEmbed(COLORS.info).setTitle(title).setDescription(description);
|
||||
}
|
||||
|
||||
export function successEmbed(description) {
|
||||
return baseEmbed(COLORS.success).setTitle('Succès').setDescription(description);
|
||||
export function successEmbed(description, { title = TONE.success } = {}) {
|
||||
return baseEmbed(COLORS.success).setTitle(title).setDescription(description);
|
||||
}
|
||||
|
||||
export function errorEmbed(description) {
|
||||
return baseEmbed(COLORS.error).setTitle('Erreur').setDescription(description);
|
||||
export function warningEmbed(description, { title = TONE.warning } = {}) {
|
||||
return baseEmbed(COLORS.warning).setTitle(title).setDescription(description);
|
||||
}
|
||||
|
||||
export function errorEmbed(description, { title = TONE.error } = {}) {
|
||||
return baseEmbed(COLORS.error).setTitle(title).setDescription(description);
|
||||
}
|
||||
|
||||
/** Uniform list marker, so every embed lists things the same way. */
|
||||
export function bullets(lines) {
|
||||
return lines
|
||||
.filter(Boolean)
|
||||
.map((line) => `• ${line}`)
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
/** Adds the "what you can do now" line that most replies end with. */
|
||||
export function withHint(description, hint) {
|
||||
return hint ? `${description}\n\n${hint}` : description;
|
||||
}
|
||||
Reference in new issue
Block a user