switch for all the subcommands

This commit is contained in:
Mylloon 2022-07-29 00:23:19 +02:00
parent 641b559c9b
commit cc5848b625
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -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;
}
},
};