registering code not working

i'm trying to register a subcommand but it's not working, registering a normal command works with my command handler
No description
11 Replies
d.js toolkit
d.js toolkit3mo ago
- 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! - Marked as resolved by OP
Stonehopper
Stonehopper3mo ago
this is the error
ValidationError > s.string
Expected a string primitive

Received:
| undefined

at _StringValidator.handle (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2473:70)
at _StringValidator.parse (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:939:90)
at validateDescription (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\builders\dist\index.js:1587:25)
at validateRequiredParameters (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\builders\dist\index.js:1601:3)
at MixedClass.toJSON (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\builders\dist\index.js:1838:5)
at postGuildCommand (L:\Stonehopper\DiscordBot stuff\Pebble-v14\common\js\deploy-commands.js:44:28)
at uploadGuildCommand (L:\Stonehopper\DiscordBot stuff\Pebble-v14\common\js\deploy-commands.js:77:11)
at ReadStream.<anonymous> (L:\Stonehopper\DiscordBot stuff\Pebble-v14\index.js:58:19)
at ReadStream.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
ValidationError > s.string
Expected a string primitive

Received:
| undefined

at _StringValidator.handle (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:2473:70)
at _StringValidator.parse (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@sapphire\shapeshift\dist\cjs\index.cjs:939:90)
at validateDescription (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\builders\dist\index.js:1587:25)
at validateRequiredParameters (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\builders\dist\index.js:1601:3)
at MixedClass.toJSON (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\builders\dist\index.js:1838:5)
at postGuildCommand (L:\Stonehopper\DiscordBot stuff\Pebble-v14\common\js\deploy-commands.js:44:28)
at uploadGuildCommand (L:\Stonehopper\DiscordBot stuff\Pebble-v14\common\js\deploy-commands.js:77:11)
at ReadStream.<anonymous> (L:\Stonehopper\DiscordBot stuff\Pebble-v14\index.js:58:19)
at ReadStream.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
NyR
NyR3mo ago
Your command doesn't have a description
Stonehopper
Stonehopper3mo ago
huh weird, it had one and it failed, i removed it and it failed too, i added it back and now giving different error now it's invalid form body
NyR
NyR3mo ago
Show the error then Full error would be helpful
d.js docs
d.js docs3mo ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
Stonehopper
Stonehopper3mo ago
DiscordAPIError[50035]: Invalid Form Body
application_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.
at handleErrors (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\rest\dist\index.js:1133:23)
at async SequentialHandler.queueRequest (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\rest\dist\index.js:963:14)
at async _REST.request (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async uploadGuildCommand (L:\Stonehopper\DiscordBot stuff\Pebble-v14\common\js\deploy-commands.js:77:5)
at async ReadStream.<anonymous> (L:\Stonehopper\DiscordBot stuff\Pebble-v14\index.js:58:13) {
requestBody: {
files: undefined,
json: {
options: [Array],
name: 'codes',
name_localizations: undefined,
description: 'codes',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: undefined,
dm_permission: undefined,
nsfw: undefined
}
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { application_id: [Object] }
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/applications/undefined/guilds/727247015129383053/commands'
}
DiscordAPIError[50035]: Invalid Form Body
application_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.
at handleErrors (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\rest\dist\index.js:1133:23)
at async SequentialHandler.queueRequest (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\rest\dist\index.js:963:14)
at async _REST.request (L:\Stonehopper\DiscordBot stuff\Pebble-v14\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async uploadGuildCommand (L:\Stonehopper\DiscordBot stuff\Pebble-v14\common\js\deploy-commands.js:77:5)
at async ReadStream.<anonymous> (L:\Stonehopper\DiscordBot stuff\Pebble-v14\index.js:58:13) {
requestBody: {
files: undefined,
json: {
options: [Array],
name: 'codes',
name_localizations: undefined,
description: 'codes',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: undefined,
dm_permission: undefined,
nsfw: undefined
}
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { application_id: [Object] }
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/applications/undefined/guilds/727247015129383053/commands'
}
NyR
NyR3mo ago
Your bot id is undefined Wherever you are deploying commands, you are passing undefined id
Stonehopper
Stonehopper3mo ago
yeah i think i'm having some async issues need to recheck cause earlier the command handler was working with a simple ping command
NyR
NyR3mo ago
You need to check your deploy-commands.js file
Stonehopper
Stonehopper3mo ago
ok fixed was using client.id instead of client.application.id ty for helping troubleshooting
Want results from more Discord servers?
Add your server