Stuck on 'registering slash commands' on deploy-commands.js
I'm new to making Discord Bots so I can't figure out what the problem is. So basically I want to make a bot based on Discord.Js guide. I'm using V14 version. I rewrote code from guild commands section and when I insert node deploy-commands.js (in which file I inserted the code) an error occurs
PS E:\PatBot V2> node deploy-commands.js
Started refreshing 0 application (/) commands.
DiscordAPIError[50035]: Invalid Form Body
application_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.
at SequentialHandler.runRequest (E:\PatBot V2\node_modules\@discordjs\rest\dist\index.js:659:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.queueRequest (E:\PatBot V2\node_modules\@discordjs\rest\dist\index.js:458:14)
at async REST.request (E:\PatBot V2\node_modules\@discordjs\rest\dist\index.js:902:22)
at async E:\PatBot V2\deploy-commands.js:24:16 {
requestBody: { files: undefined, json: [] },
rawError: {
code: 50035,
errors: { application_id: [Object] },
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/undefined/guilds/1037350741880352869/commands'
}
I tried searching for tutorials on the internet but couldn't find anything based on this guide.
The whole code is based on a guide so variable names aren't changed
Posted Nov 3, 2022, 8:28 AM UTC