switch for all the subcommands
This commit is contained in:
parent
641b559c9b
commit
cc5848b625
1 changed files with 23 additions and 1 deletions
|
@ -137,8 +137,30 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
interaction: async (interaction: ChatInputCommandInteraction, client: Client) => {
|
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 */
|
/* 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;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue