Error - UNION_TYPE_CHOICES

Hey there, I just updated my bot to the latest version and am now having some trouble with deploying commands, the error is:
rawError: {
code: 50035,
errors: {
'8': {
options: {
'0': {
_errors: [
{
code: 'UNION_TYPE_CHOICES',
message: 'Value of field "type" must be one of (3, 7, 10, 4, 5, 11, 6, 8, 9, 1, 2).'
}
]
},
'1': {
_errors: [
{
code: 'UNION_TYPE_CHOICES',
message: 'Value of field "type" must be one of (3, 7, 10, 4, 5, 11, 6, 8, 9, 1, 2).'
}
]
}
}
},
'36': {
options: {
'0': {
_errors: [
{
code: 'UNION_TYPE_CHOICES',
message: 'Value of field "type" must be one of (3, 7, 10, 4, 5, 11, 6, 8, 9, 1, 2).'
}
]
}
}
}
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/980797090718433301/commands'
}
rawError: {
code: 50035,
errors: {
'8': {
options: {
'0': {
_errors: [
{
code: 'UNION_TYPE_CHOICES',
message: 'Value of field "type" must be one of (3, 7, 10, 4, 5, 11, 6, 8, 9, 1, 2).'
}
]
},
'1': {
_errors: [
{
code: 'UNION_TYPE_CHOICES',
message: 'Value of field "type" must be one of (3, 7, 10, 4, 5, 11, 6, 8, 9, 1, 2).'
}
]
}
}
},
'36': {
options: {
'0': {
_errors: [
{
code: 'UNION_TYPE_CHOICES',
message: 'Value of field "type" must be one of (3, 7, 10, 4, 5, 11, 6, 8, 9, 1, 2).'
}
]
}
}
}
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/980797090718433301/commands'
}
I've tried looking into slashcommands with options but to no luck, for more information here is my deploy npm script
const { REST, Routes } = require("discord.js");
const LoadCommands = require("../util/loadCommands");

(async (client) => {
const config = require("../config")
const rest = new REST({ version: "10" }).setToken(config.token);
const commands = await LoadCommands().then((cmds) => {
return [].concat(cmds.slash).concat(cmds.context);
});

console.log(`[/] | Started refreshing application commands`);
await rest
.put(Routes.applicationCommands(config.clientId), {
body: commands,
});
console.log(`[/] | Refreshed all application commands`)
})();
const { REST, Routes } = require("discord.js");
const LoadCommands = require("../util/loadCommands");

(async (client) => {
const config = require("../config")
const rest = new REST({ version: "10" }).setToken(config.token);
const commands = await LoadCommands().then((cmds) => {
return [].concat(cmds.slash).concat(cmds.context);
});

console.log(`[/] | Started refreshing application commands`);
await rest
.put(Routes.applicationCommands(config.clientId), {
body: commands,
});
console.log(`[/] | Refreshed all application commands`)
})();
8 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Kinect3000
Kinect30003y ago
Some of ur options have invalid or missing type property
vance_
vance_OP3y ago
Hmm, alright I will look into it just checked every command and it seems to be fine yet the error persists
Kinect3000
Kinect30003y ago
The error disagrees Are you checking the options of the cmds?
vance_
vance_OP3y ago
well, yeah
Kinect3000
Kinect30003y ago
Cmd at index 8, the first 2 options Also the cmd at index 36, the first option
vance_
vance_OP3y ago
What is index referenced as herd? *here index starts with zero, so my ninth command would be one of the errors and my 38th command
Kinect3000
Kinect30003y ago
*37th It’s wrt to the commands array
Want results from more Discord servers?
Add your server