Closed maxime-lep closed 3 years ago
Even if discordjs checked if it's greater than 0 it would still throw an error so I don't understand what's the problem
Firstly why not control the user input (like discordjs does by contolling if it's not a string). Secondly why is this error not catch by the event handler ?
Ok, ty for you time and answers.
As a side note, Discord is releasing ranges soon, so you'll be able to define a minimum of 1 (and a maximum of 100) and remove validations from the code:
Issue description
Hello there, I'm encountering kind of a weird error with IntegerOption when I enter 0 or a negativ int:
C:\Users\Maxime\source\repos\Bot-discord.js_V13\node_modules\discord.js\src\rest\RequestHandler.js:298 throw new DiscordAPIError(data, res.status, request); ^
DiscordAPIError: Invalid Form Body limit: int value should be greater than or equal to 1. at RequestHandler.execute (C:\Users\Maxime\source\repos\Bot-discord.js_V13\node_modules\discord.js\src\rest\RequestHandler.js:298:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:\Users\Maxime\source\repos\Bot-discord.js_V13\node_modules\discord.js\src\rest\RequestHandler.js:50:14) at async MessageManager._fetchMany (C:\Users\Maxime\source\repos\Bot-discord.js_V13\node_modules\discord.js\src\managers\MessageManager.js:219:18) at async TextChannel.bulkDelete (C:\Users\Maxime\source\repos\Bot-discord.js_V13\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:328:20) { method: 'get', path: '/channels/889932783160528896/messages?limit=-1', code: 50035, httpStatus: 400, requestData: { json: undefined, files: [] } }
discord.js version
^13.1.0
Node.js version
v16.9.1
Operating system
Windows
Priority this issue should have
Low (slightly annoying)
Which partials do you have configured?
No Partials
Which gateway intents are you subscribing to?
GUILDS, GUILD_MESSAGES
I have tested this issue on a development release
No response