how to fix?

[ERROR] Encountered error on chat input subcommand "test" at path "/home/runner/workspace/src/commands/test.ts" 613 | * @param method - The method of the request that erred
614 | * @param url - The url of the request that erred
615 | * @param bodyData - The unparsed data for the request that errored
616 | */
617 | constructor(rawError, code, status, method, url, bodyData) {
618 | super(_DiscordAPIError.getMessage(rawError));
^
error: Invalid Form Body
data.components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,).
url: "https://discord.com/api/v10/interactions/1430313095594770584/aW50ZXJhY3Rpb246MTQzMDMxMzA5NTU5NDc3MDU4NDo2Ylh3aWlPRXdnNjV5SDhOa1o0U1RnSWtXWVZZSTE2UlJkVHlkd1l6M2JGU1RnTlNwcG8wZ29IYmhGUUM4ODVsZkRUV0lIczBjQmZ5dWlmT3pWRUZ2aG1SVllSNVZnVWZtcmFkYXNmcVVXVHB3MTRCUGpnYm82cWxORHl4cndvbA/callback?with_response=false"
code: "50035"

at new _DiscordAPIError (/home/runner/workspace/node_modules/@discordjs/rest/dist/index.js:618:5)
at /home/runner/workspace/node_modules/@discordjs/rest/dist/index.js:762:13
[ERROR] Encountered error on chat input subcommand "test" at path "/home/runner/workspace/src/commands/test.ts" 613 | * @param method - The method of the request that erred
614 | * @param url - The url of the request that erred
615 | * @param bodyData - The unparsed data for the request that errored
616 | */
617 | constructor(rawError, code, status, method, url, bodyData) {
618 | super(_DiscordAPIError.getMessage(rawError));
^
error: Invalid Form Body
data.components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,).
url: "https://discord.com/api/v10/interactions/1430313095594770584/aW50ZXJhY3Rpb246MTQzMDMxMzA5NTU5NDc3MDU4NDo2Ylh3aWlPRXdnNjV5SDhOa1o0U1RnSWtXWVZZSTE2UlJkVHlkd1l6M2JGU1RnTlNwcG8wZ29IYmhGUUM4ODVsZkRUV0lIczBjQmZ5dWlmT3pWRUZ2aG1SVllSNVZnVWZtcmFkYXNmcVVXVHB3MTRCUGpnYm82cWxORHl4cndvbA/callback?with_response=false"
code: "50035"

at new _DiscordAPIError (/home/runner/workspace/node_modules/@discordjs/rest/dist/index.js:618:5)
at /home/runner/workspace/node_modules/@discordjs/rest/dist/index.js:762:13
3 Replies
Seren_Modz 21
Seren_Modz 212mo ago
it looks like you're trying to use components v2 but are missing the IsComponentsV2 flag
d.js docs
d.js docs2mo ago
:enummember: MessageFlags#IsComponentsV2 discord.js@14.23.2 Allows you to create fully component-driven messages :propertysignature: InteractionReplyOptions#flags discord.js@14.23.2 Which flags to set for the message. Only MessageFlags.Ephemeral, MessageFlags.SuppressEmbeds, and MessageFlags.SuppressNotifications can be set.

Did you find this page helpful?