From cc5848b62531e84d3d984e319c57b2deb8f927ec Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 29 Jul 2022 00:23:19 +0200 Subject: [PATCH] switch for all the subcommands --- src/commands/misc/reminder.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 3dd6b3a..05da54c 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -137,8 +137,30 @@ 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); /* Votre code ici */ + const subcommand = interaction.options.getSubcommand(); + switch (subcommand) { + // New reminder + case loc_default?.get(`c_${filename}_sub1_name`) + ?.toLowerCase() ?? '': + break; + + // List reminders + case loc_default?.get(`c_${filename}_sub2_name`) + ?.toLowerCase() ?? '': + break; + + // Delete a reminder + case loc_default?.get(`c_${filename}_sub3_name`) + ?.toLowerCase() ?? '': + break; + + default: + console.error(`${__filename}: unknown subcommand (${subcommand})`); + break; + } }, };