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
+36
-16
@@ -24,8 +24,10 @@ export const data = new SlashCommandBuilder()
|
||||
.addSubcommand((sub) =>
|
||||
sub
|
||||
.setName('changelog')
|
||||
.setDescription("Changements d'une version")
|
||||
.addStringOption((option) => option.setName('version').setDescription('Version (dernière par défaut)')),
|
||||
.setDescription('Nouveautés d’une version')
|
||||
.addStringOption((option) =>
|
||||
option.setName('version').setDescription('Version souhaitée (la dernière par défaut)'),
|
||||
),
|
||||
);
|
||||
|
||||
const officialLinks = () => [
|
||||
@@ -62,7 +64,7 @@ async function showInfo(interaction) {
|
||||
const configured = readSetting(interaction.guildId, 'fws.info', DEFAULT_PRESENTATION);
|
||||
const description = typeof configured === 'string' && configured ? configured : DEFAULT_PRESENTATION;
|
||||
await interaction.reply({
|
||||
embeds: [baseEmbed().setTitle('FWS & FWS Arch').setDescription(description)],
|
||||
embeds: [baseEmbed().setTitle('🚀 FWS & FWS Arch').setDescription(description)],
|
||||
components: linkButtons(officialLinks()),
|
||||
});
|
||||
}
|
||||
@@ -73,8 +75,10 @@ async function showVersion(interaction) {
|
||||
await interaction.reply({
|
||||
embeds: [
|
||||
fallback
|
||||
? infoEmbed('Version FWS Arch', `Version publiée : **${fallback}**`)
|
||||
: errorEmbed('Gitea n’est pas configuré : impossible de lire la dernière version.'),
|
||||
? infoEmbed('📦 Version FWS Arch', `Dernière version publiée : **${fallback}**`)
|
||||
: errorEmbed(
|
||||
'La partie Gitea n’est pas encore configurée : je ne peux pas lire la dernière version. L’équipe peut la renseigner dans le `.env`.',
|
||||
),
|
||||
],
|
||||
});
|
||||
return;
|
||||
@@ -87,8 +91,8 @@ async function showVersion(interaction) {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
fallback
|
||||
? infoEmbed('Version FWS Arch', `Version publiée : **${fallback}**`)
|
||||
: infoEmbed('Version FWS Arch', 'Aucune release publiée pour le moment.'),
|
||||
? infoEmbed('📦 Version FWS Arch', `Dernière version publiée : **${fallback}**`)
|
||||
: infoEmbed('📦 Version FWS Arch', 'Aucune release publiée pour le moment.'),
|
||||
],
|
||||
});
|
||||
return;
|
||||
@@ -123,15 +127,15 @@ async function showStatus(interaction) {
|
||||
|
||||
const uptime = Math.floor(process.uptime());
|
||||
const embed = baseEmbed(COLORS.info)
|
||||
.setTitle('État des services')
|
||||
.setTitle('🩺 État des services')
|
||||
.addFields(
|
||||
{
|
||||
name: 'API Gitea',
|
||||
value: !giteaConfigured
|
||||
? '⚙️ Non configurée'
|
||||
? '⚙️ Pas encore configurée'
|
||||
: giteaReachable
|
||||
? `✅ En ligne — ${repositoryUrl()}`
|
||||
: '❌ Injoignable',
|
||||
: '❌ Injoignable pour le moment',
|
||||
inline: false,
|
||||
},
|
||||
{
|
||||
@@ -142,7 +146,9 @@ async function showStatus(interaction) {
|
||||
{
|
||||
name: 'Base SQLite',
|
||||
value:
|
||||
openTickets === null ? '❌ Indisponible' : `✅ Accessible — ${openTickets} ticket(s) ouvert(s)`,
|
||||
openTickets === null
|
||||
? '❌ Indisponible pour le moment'
|
||||
: `✅ Accessible — ${openTickets} ticket(s) ouvert(s)`,
|
||||
inline: false,
|
||||
},
|
||||
{
|
||||
@@ -150,7 +156,7 @@ async function showStatus(interaction) {
|
||||
value: `✅ Connecté — ${Math.round(interaction.client.ws.ping)} ms`,
|
||||
inline: false,
|
||||
},
|
||||
{ name: 'Disponibilité du bot', value: `<t:${Math.floor((Date.now() - uptime * 1000) / 1000)}:R>` },
|
||||
{ name: 'En ligne depuis', value: `<t:${Math.floor((Date.now() - uptime * 1000) / 1000)}:R>` },
|
||||
);
|
||||
|
||||
await interaction.editReply({ embeds: [embed] });
|
||||
@@ -160,7 +166,11 @@ async function showChangelog(interaction) {
|
||||
const version = interaction.options.getString('version');
|
||||
if (!isGiteaConfigured()) {
|
||||
await interaction.reply({
|
||||
embeds: [errorEmbed('Gitea n’est pas configuré : le changelog est indisponible.')],
|
||||
embeds: [
|
||||
errorEmbed(
|
||||
'La partie Gitea n’est pas encore configurée : le changelog arrivera dès qu’elle sera branchée.',
|
||||
),
|
||||
],
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -170,7 +180,12 @@ async function showChangelog(interaction) {
|
||||
const release = version ? await gitea.getReleaseByTag(version) : await latestRelease();
|
||||
if (!release) {
|
||||
await interaction.editReply({
|
||||
embeds: [infoEmbed('Changelog', `Aucune release trouvée pour **${version}**.`)],
|
||||
embeds: [
|
||||
infoEmbed(
|
||||
'📜 Changelog',
|
||||
`Je ne trouve aucune release pour **${version}** : \`/gitea release\` liste les versions existantes.`,
|
||||
),
|
||||
],
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -183,7 +198,12 @@ async function showChangelog(interaction) {
|
||||
if (version) {
|
||||
log.warn(`Release ${version} not found`, error);
|
||||
await interaction.editReply({
|
||||
embeds: [infoEmbed('Changelog', `La version **${version}** n’existe pas dans les releases Gitea.`)],
|
||||
embeds: [
|
||||
infoEmbed(
|
||||
'📜 Changelog',
|
||||
`Cette version **${version}** n’existe pas dans les releases Gitea : \`/gitea release\` liste celles qui existent.`,
|
||||
),
|
||||
],
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -199,7 +219,7 @@ export async function execute(interaction) {
|
||||
return;
|
||||
case 'links':
|
||||
await interaction.reply({
|
||||
embeds: [baseEmbed().setTitle('Liens officiels FWS')],
|
||||
embeds: [baseEmbed().setTitle('🔗 Liens officiels FWS')],
|
||||
components: linkButtons(officialLinks()),
|
||||
});
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user