Deploy Command.js Fails #1502
Unanswered
IAmNolanPerry
asked this question in
Q&A
Replies: 1 comment
-
I suggest giving the registering command guide another read. As I can see in the error, both the application id and the guild id in the deploy URL come out as undefined const { clientId, guildId, token } = require('./config.json');
// ...
const data = await rest.put(
Routes.applicationGuildCommands(clientId, guildId),
{ body: commands },
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
The API returns invalid form body when using the Deploy placed in the guide.
To Reproduce
C:\Users\Master\Desktop\cum>node deploy.js
Started refreshing 2 application (/) commands.
DiscordAPIError[50035]: Invalid Form Body
application_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.
guild_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.
at handleErrors (C:\Users\Master\Desktop\cum\node_modules@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\Master\Desktop\cum\node_modules@discordjs\rest\dist\index.js:1072:23)
at async SequentialHandler.queueRequest (C:\Users\Master\Desktop\cum\node_modules@discordjs\rest\dist\index.js:913:14)
at async _REST.request (C:\Users\Master\Desktop\cum\node_modules@discordjs\rest\dist\index.js:1218:22)
at async C:\Users\Master\Desktop\cum\deploy.js:36:16 {
requestBody: { files: undefined, json: [ [Object], [Object] ] },
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { application_id: [Object], guild_id: [Object] }
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/undefined/guilds/undefined/commands'
}
Screenshots
No response
Device (please complete the following information)
Windows 10
Additional notes
No response
Beta Was this translation helpful? Give feedback.
All reactions