Wanted to register a command and got this error:

Wanted to register a command and got this error: Started refreshing application (/) commands. DiscordAPIError[50035]: Invalid Form Body 0.options[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (8, 10, 6, 1, 2, 4, 5, 11, 9, 3, 7). 0.options[1][UNION_TYPE_CHOICES]: Value of field "type" must be one of (8, 10, 6, 1, 2, 4, 5, 11, 9, 3, 7). at handleErrors (C:\Users\win 10\OneDrive\Desktop\FB\node_modules@discordjs\rest\dist\index.js:722:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SequentialHandler.runRequest (C:\Users\win 10\OneDrive\Desktop\FB\node_modules@discordjs\rest\dist\index.js:1120:23) at async SequentialHandler.queueRequest (C:\Users\win 10\OneDrive\Desktop\FB\node_modules@discordjs\rest\dist\index.js:953:14) at async _REST.request (C:\Users\win 10\OneDrive\Desktop\FB\node_modules@discordjs\rest\dist\index.js:1266:22) at async C:\Users\win 10\OneDrive\Desktop\FB\register-commands.js:33:5 { requestBody: { files: undefined, json: [ [Object] ] }, rawError: { message: 'Invalid Form Body', code: 50035, errors: { '0': [Object] } }, code: 50035, status: 400, method: 'PUT', url:
10 Replies
d.js toolkit
d.js toolkit6mo 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 staff
treble/luna
treble/luna6mo ago
show your command cpde one or more of your commands have invalid options
Fisch
Fisch6mo ago
I even tried using the guide But mixed something with AI For the command
treble/luna
treble/luna6mo ago
again dont ask ai its outdated and will only cause issues
treble/luna
treble/luna6mo ago
yep what i thought option type is a number not a string
d.js docs
d.js docs6mo ago
dtypes v10: ApplicationCommandOptionType read more
treble/luna
treble/luna6mo ago
you also do not need to deploy your commands every time your bot starts
Fisch
Fisch6mo ago
So I just type 3 in there?
treble/luna
treble/luna6mo ago
or just use the enum