discord.js-selfbot-v13 icon indicating copy to clipboard operation
discord.js-selfbot-v13 copied to clipboard

DiscordAPIError: Invalid Form Body crash

Open AdamSaketume26 opened this issue 1 year ago • 2 comments

Which package has the bugs?

The core library

Issue description

When I try to click buttons sometimes my code crashes. is this because i am using more than one client and rate limit? but http status is 400 and not ratelimit. i am checking to see if button is disabled before clicks but it still gives me error and crashes my script even if i put try and catch before the button click

c:\discord\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:415 throw new DiscordAPIError(data, res.status, request); ^ DiscordAPIError: Invalid Form Body COMPONENT_VALIDATION_FAILED: Component validation failed at RequestHandler.execute (c:\discord\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:415:13) at processTicksAndRejections (node:internal/process/task_queues:95:5) at async RequestHandler.push (c:\discord\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:63:14) { method: 'post', path: '/interactions', code: 50035, httpStatus: 400, requestData: { json: { type: 3, nonce: '1111111111111111111', guild_id: '1111111111111111111', channel_id: '1111111111111111111', message_id: '1111111111111111111', application_id: '1111111111111111111', session_id: 'numbers and letters', message_flags: 0, data: [Object] }, files: [], headers: undefined }, retries: 0, captcha: null }

Code sample

await message.clickButton("id");

Package version

3.1.4 github

Node.js version

20.12.2

Operating system

No response

Priority this issue should have

Low (slightly annoying)

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shared the entire traceback.
  • [X] I am using a user token (and it isn't visible in the code).

Additional Information

No response

AdamSaketume26 avatar Apr 28 '24 09:04 AdamSaketume26

I have the same problem, do you find any method to solve it?

JueXiuHuang avatar May 16 '24 11:05 JueXiuHuang

can u log data (Object)

aiko-chan-ai avatar Jun 17 '24 15:06 aiko-chan-ai

@aiko-chan-ai sry i didnt see this for long time but i start project again and im having this issue again. i updated library and still having problems. this time data: [Object] is logged now but i dont remember changing anything

\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:415 throw new DiscordAPIError(data, res.status, request); ^

DiscordAPIError: Invalid Form Body COMPONENT_VALIDATION_FAILED: Component validation failed at RequestHandler.execute (\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:415:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async RequestHandler.push (\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:63:14) { method: 'post', path: '/interactions', code: 50035, httpStatus: 400, requestData: { json: { type: 3, nonce: '1111111111111111111', guild_id: '1111111111111111111', channel_id: '1111111111111111111', message_id: '1111111111111111111', application_id: '1111111111111111111', session_id: 'session id numbers and letters', message_flags: 0, data: { component_type: 2, custom_id: 'the custom id of message.components[0].components.customId' } }, files: [], headers: undefined }, retries: 0, captcha: null }

the custom_id was correct because i saw my own logging and the custom_id in the error matched one of the custom_id of my message component object

the error happens when doing message.clickButton

AdamSaketume26 avatar Jul 29 '24 06:07 AdamSaketume26