Compare commits
No commits in common. "adad5db3645b45ea2b1a4468f19f6ee0e1d0811a" and "2f9053bcc914a779d4d96362d4f0c16d28229911" have entirely different histories.
adad5db364
...
2f9053bcc9
2 changed files with 12 additions and 27 deletions
|
@ -17,7 +17,6 @@ export default {
|
|||
getLocalizations(client, `c_${filename}_name`, true))
|
||||
.setDescriptionLocalizations(
|
||||
getLocalizations(client, `c_${filename}_desc`))
|
||||
|
||||
.addStringOption(option => option
|
||||
.setName(client.locales.get(client.config.default_lang)
|
||||
?.get(`c_${filename}_opt1_name`) ?? '')
|
||||
|
@ -37,8 +36,11 @@ export default {
|
|||
.get(client.config.default_lang)
|
||||
?.get(`c_${getFilename(__filename)}_opt1_name`) ?? '');
|
||||
|
||||
// If a command isn't specified
|
||||
if (!desired_command) {
|
||||
// If a command is specified
|
||||
if (desired_command) {
|
||||
// Check if command exists
|
||||
interaction.reply({ content: 'WIP', ephemeral: true });
|
||||
} else {
|
||||
const fields: {
|
||||
name: string;
|
||||
value: string;
|
||||
|
@ -46,21 +48,21 @@ export default {
|
|||
|
||||
client.commands.categories.forEach((commands_name, category) => {
|
||||
const commands_description = commands_name.reduce(
|
||||
(data, command_name) => {
|
||||
(compteur, command_name) => {
|
||||
const command = client.commands.list.get(command_name);
|
||||
data += `- \`/${command?.data.name}\` : `;
|
||||
let res = `${compteur}- \`${command_name}\` : `;
|
||||
if (command?.data) {
|
||||
const description =
|
||||
command.data.description_localizations
|
||||
?.[interaction.locale as Locale]
|
||||
?? command.data.description;
|
||||
|
||||
data += `${description}\n`;
|
||||
res += `${description}\n`;
|
||||
} else {
|
||||
data += `${loc.get('c_help3')}\n`;
|
||||
res += `${loc.get('c_help3')}\n`;
|
||||
}
|
||||
|
||||
return data;
|
||||
return res;
|
||||
}, '');
|
||||
|
||||
fields.push({
|
||||
|
@ -69,7 +71,7 @@ export default {
|
|||
});
|
||||
});
|
||||
|
||||
return interaction.reply({ embeds: [
|
||||
interaction.reply({ embeds: [
|
||||
new MessageEmbed()
|
||||
.setColor('BLURPLE')
|
||||
.setTitle(loc.get('c_help1'))
|
||||
|
@ -77,21 +79,5 @@ export default {
|
|||
.addFields(fields),
|
||||
] });
|
||||
}
|
||||
|
||||
// If a command is specified
|
||||
const command = client.commands.list.get(desired_command);
|
||||
if (!command) {
|
||||
return interaction.reply({
|
||||
content: `${loc.get('c_help4')} \`${desired_command}\``,
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
|
||||
return interaction.reply({ embeds: [
|
||||
new MessageEmbed()
|
||||
.setColor('BLURPLE')
|
||||
.setTitle('`/' + command.data.name + '`')
|
||||
.setDescription(command.data.description),
|
||||
] });
|
||||
},
|
||||
};
|
||||
|
|
|
@ -12,6 +12,5 @@
|
|||
"c_help_opt1_desc": "Commande voulu en détail.",
|
||||
"c_help1": "Liste des catégories et des commandes associées",
|
||||
"c_help2": "`/help <commande>` pour obtenir plus d'informations sur une commande.",
|
||||
"c_help3": "Pas d'information.",
|
||||
"c_help4": "Impossible de trouver :"
|
||||
"c_help3": "Pas d'information."
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue