Config.js slash command file causing an unknown error

https://srcshare.io/6335d122024e05a199118f38 Discord.js = v14.3.0 Node = v16.14.0 Nodemon = 2.0.20
SrcShare
Easily share your source code with other developers.
5 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
PAdventures
PAdventuresOP3y ago
Note the link contains the config.js file and the slash command handler
duck
duck3y ago
maybe it would be more helpful if you didn't override the actual error's message with your own
PAdventures
PAdventuresOP3y ago
k
DiscordAPIError[50035]: Invalid Form Body
6.options[1].options[2][APPLICATION_COMMAND_OPTIONS_REQUIRED_INVALID]: Required options must be placed before non-required options
at SequentialHandler.runRequest (D:\Yara Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:293:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (D:\Yara Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:99:14)
at async REST.request (D:\Yara Bot\node_modules\@discordjs\rest\dist\lib\REST.cjs:52:22)
at async D:\Yara Bot\index.js:74:16 {
rawError: {
code: 50035,
errors: { '6': [Object] },
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1018070337985974302/commands',
requestBody: {
files: undefined,
json: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
]
}
}
DiscordAPIError[50035]: Invalid Form Body
6.options[1].options[2][APPLICATION_COMMAND_OPTIONS_REQUIRED_INVALID]: Required options must be placed before non-required options
at SequentialHandler.runRequest (D:\Yara Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:293:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (D:\Yara Bot\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:99:14)
at async REST.request (D:\Yara Bot\node_modules\@discordjs\rest\dist\lib\REST.cjs:52:22)
at async D:\Yara Bot\index.js:74:16 {
rawError: {
code: 50035,
errors: { '6': [Object] },
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/1018070337985974302/commands',
requestBody: {
files: undefined,
json: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object]
]
}
}
duck
duck3y ago
6.options[1].options[2][APPLICATION_COMMAND_OPTIONS_REQUIRED_INVALID]: Required options must be placed before non-required options
seems pretty straightforward
Want results from more Discord servers?
Add your server