better handle of options

This commit is contained in:
Mylloon 2022-07-27 16:16:00 +02:00
parent decd0b65f3
commit d3670de641
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -33,12 +33,10 @@ export default {
interaction: async (interaction: CommandInteraction, client: Client) => {
const loc = getLocale(client, interaction.locale);
const desired_command = (
interaction.options as CommandInteractionOptionResolver
).getString(client
const desired_command = interaction.options.get(client
.locales
.get(client.config.default_lang)
?.get(`c_${getFilename(__filename)}_opt1_name`) ?? '');
?.get(`c_${getFilename(__filename)}_opt1_name`) ?? '')?.value as string;
// If a command isn't specified
if (!desired_command) {