From 89e4b1eacd7c9cfbf5c75ae13d405db642b7e414 Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Sun, 28 Mar 2021 18:22:42 +0200 Subject: [PATCH] fix(util/utils): fix logic error in validateSlashOptions() (#699) --- src/util/utils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/utils.ts b/src/util/utils.ts index d65febec9..1cbd16107 100644 --- a/src/util/utils.ts +++ b/src/util/utils.ts @@ -140,9 +140,10 @@ function validateSlashOptionChoices( function validateSlashOptions(options: SlashCommandOption[]) { for (const option of options) { if ( - (option.choices?.length && option.choices.length > 25) || - option.type !== SlashCommandOptionType.STRING && - option.type !== SlashCommandOptionType.INTEGER + option.choices?.length && + (option.choices.length > 25 || + (option.type !== SlashCommandOptionType.STRING && + option.type !== SlashCommandOptionType.INTEGER)) ) { throw new Error(Errors.INVALID_SLASH_OPTIONS_CHOICES); }