'Missing Access for Slash Commands

Heres the error message:

PS C:\Users\User\Documents\Discord Bot> node .
ready
C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:154
      throw new DiscordAPIError(request.path, data, request.method, res.status);
            ^

DiscordAPIError: Missing Access
    at RequestHandler.execute (C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async RequestHandler.push (C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
  method: 'post',
  path: '/applications/723863781607997451/guilds/722043668730740788/commands',
  code: 50001,
  httpStatus: 403
}

Help is appreciated. This is my first post on stackoverflow, so if I'm posting something wrong, please tell me!



Solution 1:[1]

Your application needs access to application.commands!

You can do all of this by clicking here, going to your Developer Page. You can then select the following on the OAuth2 page: picture of scopes and bot permissions on discord developer page (Screenshots Outdated: OAuth Scope got changed and applications.commands.scope no longer exists. You DO NOT need it, and just need applications.commands!)

Incase that doesn't help, you can also read the Discord documentation for Slash Commands

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1