diff --git a/packages/builders/__tests__/interactions/SlashCommands/Options.test.ts b/packages/builders/__tests__/interactions/SlashCommands/Options.test.ts index 57d4a56f7..3a8670c6a 100644 --- a/packages/builders/__tests__/interactions/SlashCommands/Options.test.ts +++ b/packages/builders/__tests__/interactions/SlashCommands/Options.test.ts @@ -39,7 +39,7 @@ const getIntegerOption = () => .setName('owo') .setDescription('Testing 123') .setRequired(true) - .setMinValue(1) + .setMinValue(-1) .setMaxValue(10); const getNumberOption = () => @@ -47,7 +47,7 @@ const getNumberOption = () => .setName('owo') .setDescription('Testing 123') .setRequired(true) - .setMinValue(1) + .setMinValue(-1.23) .setMaxValue(10); const getUserOption = () => new SlashCommandUserOption().setName('owo').setDescription('Testing 123').setRequired(true); @@ -84,7 +84,7 @@ describe('Application Command toJSON() results', () => { type: ApplicationCommandOptionType.Integer, required: true, max_value: 10, - min_value: 1, + min_value: -1, }); expect(getIntegerOption().setAutocomplete(true).setChoices().toJSON()).toEqual({ @@ -93,7 +93,7 @@ describe('Application Command toJSON() results', () => { type: ApplicationCommandOptionType.Integer, required: true, max_value: 10, - min_value: 1, + min_value: -1, autocomplete: true, // @ts-expect-error TODO: you *can* send an empty array with autocomplete: true, should correct that in types choices: [], @@ -107,7 +107,7 @@ describe('Application Command toJSON() results', () => { type: ApplicationCommandOptionType.Integer, required: true, max_value: 10, - min_value: 1, + min_value: -1, choices: [{ name: 'uwu', value: 1 }], }); }); @@ -128,7 +128,7 @@ describe('Application Command toJSON() results', () => { type: ApplicationCommandOptionType.Number, required: true, max_value: 10, - min_value: 1, + min_value: -1.23, }); expect(getNumberOption().setAutocomplete(true).setChoices().toJSON()).toEqual({ @@ -137,7 +137,7 @@ describe('Application Command toJSON() results', () => { type: ApplicationCommandOptionType.Number, required: true, max_value: 10, - min_value: 1, + min_value: -1.23, autocomplete: true, // @ts-expect-error TODO: you *can* send an empty array with autocomplete: true, should correct that in types choices: [], @@ -149,7 +149,7 @@ describe('Application Command toJSON() results', () => { type: ApplicationCommandOptionType.Number, required: true, max_value: 10, - min_value: 1, + min_value: -1.23, choices: [{ name: 'uwu', value: 1 }], }); }); diff --git a/packages/builders/src/interactions/slashCommands/options/integer.ts b/packages/builders/src/interactions/slashCommands/options/integer.ts index 07126b6ba..5759a9ec1 100644 --- a/packages/builders/src/interactions/slashCommands/options/integer.ts +++ b/packages/builders/src/interactions/slashCommands/options/integer.ts @@ -5,7 +5,7 @@ import { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/Appli import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase'; import { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin'; -const numberValidator = z.number().int().nonnegative(); +const numberValidator = z.number().int(); @mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin) export class SlashCommandIntegerOption diff --git a/packages/builders/src/interactions/slashCommands/options/number.ts b/packages/builders/src/interactions/slashCommands/options/number.ts index b88ce33f5..cc55ced5b 100644 --- a/packages/builders/src/interactions/slashCommands/options/number.ts +++ b/packages/builders/src/interactions/slashCommands/options/number.ts @@ -5,7 +5,7 @@ import { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/Appli import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase'; import { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin'; -const numberValidator = z.number().nonnegative(); +const numberValidator = z.number(); @mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin) export class SlashCommandNumberOption