Problem with Modal Builders
node:events:497
throw er; // Unhandled 'error' event
^
DiscordAPIError[50035]: Invalid Form Body
data.custom_id[BASE_TYPE_REQUIRED]: This field is required
data.title[BASE_TYPE_REQUIRED]: This field is required
data.components[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ButtonInteraction.showModal (/Users/nils/development/discord-bot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:253:5)
at async Client.<anonymous> (/Users/nils/development/discord-bot/src/index.js:82:3)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: { type: 9, data: {} } },
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: {
data: {
custom_id: { _errors: [ [Object] ] },
title: { _errors: [ [Object] ] },
components: { _errors: [ [Object] ] }
}
}
},
code: 50035,
status: 400,
method: 'POST',
}
why this wont work?
2 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!ok
DiscordAPIError[50035]: Invalid Form Body
components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,).
at handleErrors (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:1120:23)
at async SequentialHandler.queueRequest (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:953:14)
at async _REST.request (/Users/nils/development/discord-bot/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async TextChannel.send (/Users/nils/development/discord-bot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:155:15)
at async /Users/nils/development/discord-bot/src/index.js:89:5 {
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [Array],
components: [Array],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { components: [Object] }
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1224773916279439430/messages'
}
but what is here the problem
it comes when i make channel.send()
@Qjuh