use locales

This commit is contained in:
Mylloon 2023-02-05 01:04:50 +01:00
parent ae5f8799a8
commit 6473d0769e
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 12 additions and 6 deletions

View file

@ -6,7 +6,7 @@ import {
VoiceBasedChannel,
} from "discord.js";
import { Metadata } from "../../modules/metadata";
import { getLocalizations } from "../../utils/locales";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
export default {
@ -38,6 +38,7 @@ export default {
},
interaction: async (interaction: ChatInputCommandInteraction, client: Client) => {
const loc = getLocale(client, interaction.locale);
const loc_default = client.locales.get(client.config.default_lang);
const filename = getFilename(__filename);
@ -47,7 +48,7 @@ export default {
if (!member?.voice.channelId) {
return await interaction.reply({
content: "Tu n'es dans aucun salon vocal.",
content: loc.get("c_play1"),
ephemeral: true,
});
}
@ -57,7 +58,7 @@ export default {
member.voice.channelId !== interaction.guild.members.me.voice.channelId
) {
return await interaction.reply({
content: "Je suis déjà en vocal.",
content: loc.get("c_play2"),
ephemeral: true,
});
}
@ -77,7 +78,7 @@ export default {
} catch {
queue.destroy();
return await interaction.reply({
content: "Impossible de rejoindre le salon vocal.",
content: loc.get("c_play3"),
ephemeral: true,
});
}
@ -90,13 +91,13 @@ export default {
.then((x) => x.tracks[0]);
if (!track) {
return await interaction.followUp({ content: `❌ | \`${query}\` introuvable.` });
return await interaction.followUp({ content: `❌ | \`${query}\` ${loc.get("c_play4")}.` });
}
queue.play(track);
return await interaction.followUp({
content: `⏱️ | \`${track.title}\` ajouté à la file d'attente`,
content: `⏱️ | \`${track.title}\` ${loc.get("c_play5")}.`,
});
},
};

View file

@ -82,6 +82,11 @@
"c_play_desc": "Joue une chanson/playlist",
"c_play_opt1_name": "requête",
"c_play_opt1_desc": "Ce que vous voulez écouter",
"c_play1": "Tu n'es dans aucun salon vocal.",
"c_play2": "Je suis déjà en vocal.",
"c_play3": "Impossible de rejoindre le salon vocal.",
"c_play4": "introuvable",
"c_play5": "ajouté à la file d'attente",
"c_stop_name": "stop",
"c_stop_desc": "Stop la musique",
"c_stop1": "Le bot ne joue pas de musique.",