Trying to delete all of my slash commands so I can re-add the singular one I now have but err

Not sure why I'm getting this error...
/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Missing Access
at RequestHandler.execute (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async ApplicationCommandManager.set (/root/bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:156:18) {
method: 'put',
path: '/applications/739190110402379876/guilds/718253204147798000/commands',
/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Missing Access
at RequestHandler.execute (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async ApplicationCommandManager.set (/root/bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:156:18) {
method: 'put',
path: '/applications/739190110402379876/guilds/718253204147798000/commands',
This is my ready.js file:
const config = require('../config/config.json');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const bot = require('../config/bot.json');

module.exports = {
name: 'ready',
once: true,
async execute(client) {
console.log('|-----------------------------------|')
console.log(' Logging In... ')
console.log('|-----------------------------------|')
console.log(` ${client.user.tag} is\n logged in and ready!`);
console.log('|-----------------------------------|')
console.log(' Error Logs... ')
console.log('|-----------------------------------|')

client.user.setPresence({ activities: [{ name: 'Use ++ prefix' }] });

const rest = new REST({ version: '9' }).setToken(config.token);

client.application.commands.set([], 718253204147798047);

}
}
const config = require('../config/config.json');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const bot = require('../config/bot.json');

module.exports = {
name: 'ready',
once: true,
async execute(client) {
console.log('|-----------------------------------|')
console.log(' Logging In... ')
console.log('|-----------------------------------|')
console.log(` ${client.user.tag} is\n logged in and ready!`);
console.log('|-----------------------------------|')
console.log(' Error Logs... ')
console.log('|-----------------------------------|')

client.user.setPresence({ activities: [{ name: 'Use ++ prefix' }] });

const rest = new REST({ version: '9' }).setToken(config.token);

client.application.commands.set([], 718253204147798047);

}
}
13 Replies
chewie
chewie3y ago
<#769862166131245066> missing the applications.commands scope
Erin
ErinOP3y ago
I already kicked and re-added the bot to my server with the applications.commands
chewie
chewie3y ago
error disagrees with you.
Erin
ErinOP3y ago
Erin
ErinOP3y ago
Erin
ErinOP3y ago
My eyes disagree with the error.
chewie
chewie3y ago
I rather believe the error. 718253204147798047 that guild needs it with that scope
Erin
ErinOP3y ago
Did the exact same thing again (kicked and re-added the bot and made sure everything was checked) same error.
Jaworek
Jaworek3y ago
are sure that u re doing it on right guild?
Erin
ErinOP3y ago
Yes, I copied and pasted the guild ID into this box, and made sure it matched. Yes, I only have 1 bot Everything matches, it is the weirdest thing. I did have it in 2 servers so I kicked it from both and used the url https://discord.com/api/oauth2/authorize?client_id=739190110402379876&permissions=8&scope=bot%20applications.commands to re-add it and still same error. I feel like I'm going insane. Could this be the issue?
method: 'put',
path: '/applications/739190110402379876/guilds/718253204147798000/commands',
code: 50001,
method: 'put',
path: '/applications/739190110402379876/guilds/718253204147798000/commands',
code: 50001,
That is part of the error... Entire thing:
bot/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Missing Access
at RequestHandler.execute (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async ApplicationCommandManager.set (/root/bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:156:18) {
method: 'put',
path: '/applications/739190110402379876/guilds/718253204147798000/commands',
code: 50001,
httpStatus: 403,
requestData: { json: [], files: [] }
}
bot/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Missing Access
at RequestHandler.execute (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async ApplicationCommandManager.set (/root/bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:156:18) {
method: 'put',
path: '/applications/739190110402379876/guilds/718253204147798000/commands',
code: 50001,
httpStatus: 403,
requestData: { json: [], files: [] }
}
chewie
chewie3y ago
thats the error telling you that you are missing that specific scope on the guild 718253204147798000 for the bot 739190110402379876
Erin
ErinOP3y ago
The issue was this:
client.application.commands.set([], '718253204147798047');
client.application.commands.set([], '718253204147798047');
047 number needed to be in quotes wow
chewie
chewie3y ago
oh well, didnt see that one
Want results from more Discord servers?
Add your server