mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
fix(util/utils): fix logic error in validateSlashOptions() (#699)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user