APPLICATION_COMMANDS_DUPLICATE_NAME Error Showing UP

For the last few hours, I have been trying to figure out a resolution to this error. And if you see the name it says there is a duplicate of a command in the Main Command Folder. I checked the folder, no duplicated instances were found. Anyone have any idea why this issue is occurring?
rawError: {
code: 50035,
errors: {
'2': {
_errors: [
{
code: 'APPLICATION_COMMANDS_DUPLICATE_NAME',
message: 'Application command names must be unique'
}
]
}
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/___/commands',
}
}
rawError: {
code: 50035,
errors: {
'2': {
_errors: [
{
code: 'APPLICATION_COMMANDS_DUPLICATE_NAME',
message: 'Application command names must be unique'
}
]
}
},
message: 'Invalid Form Body'
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/___/commands',
}
}
11 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
oz6n
oz6nOP3y ago
I can't include the lower, since it is more than 1000+
조아오
조아오3y ago
'Application command names must be unique' You are trying to set an array of commands that some of them have the same name
monbrey
monbrey3y ago
I dont know if this is still a bug, but there used to be a problem where setting a slash command and a context command of the same name in the same payload would cause this But you could still create them separately
조아오
조아오3y ago
Cc: @appellation Do you know if this is still a thing?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
조아오
조아오3y ago
Okk Could not repro
import { inspect } from "node:util";
import { fetch } from "undici";

inspect.defaultOptions.depth = null;

const url = "https://discord.com/api/v10/applications/id/guilds/id/commands";

const testCommands = [
{
name: "test",
description: "Test",
type: 1,
options: [],
},
{
name: "test",
type: 2,
},
{
name: "test",
type: 3,
},
];

fetch(url, {
body: JSON.stringify(testCommands),
method: "PUT",
headers: {
Authorization: "Bot <redacted>",
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log(res.status);
console.log(JSON.stringify(testCommands, null, 2));
console.dir(await res.json());
})
.catch(console.error);
import { inspect } from "node:util";
import { fetch } from "undici";

inspect.defaultOptions.depth = null;

const url = "https://discord.com/api/v10/applications/id/guilds/id/commands";

const testCommands = [
{
name: "test",
description: "Test",
type: 1,
options: [],
},
{
name: "test",
type: 2,
},
{
name: "test",
type: 3,
},
];

fetch(url, {
body: JSON.stringify(testCommands),
method: "PUT",
headers: {
Authorization: "Bot <redacted>",
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log(res.status);
console.log(JSON.stringify(testCommands, null, 2));
console.dir(await res.json());
})
.catch(console.error);
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
monbrey
monbrey3y ago
how dare you
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
oz6n
oz6nOP3y ago
So how can I prevent this error?
Want results from more Discord servers?
Add your server