Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 307
Yan Avatar asked Jan 02 '21 13:01

Yan


People also ask

Why cant I use slash commands?

If your app has no slash commands, that means your developer hasn't migrated to them yet. You can visit their support server or contact them to let them know - they might be juggling a lot, life can get busy!

How do I fix missing access in Discord?

You can fix this by setting up your role perm or category perm hierarchy so the bot will have access to all channels that are created. Another possible cause is that you're locking the permissions for @everyone first which is locking the bots permissions.

Is Discord forcing slash commands?

tl;dr, Discord is forcing bots that are in over 75 servers to make use of slash commands, because Discord will no longer send raw messages starting April 2022. So no more `! pause`, or whatever else you might normally type.

How do I turn off slash commands?

You can turn off Slash Commands for your entire server or for a specific channel by changing that permission. The "Use Slash Commands" permission only affects commands created by bots. "Built-in" commands like /giphy, /nick, and /me will be unaffected.

What is the new'use slash commands'permission?

So, we've added a new "Use Slash Commands" permission to help keep your server organized. You can turn off Slash Commands for your entire server or for a specific channel by changing that permission. The "Use Slash Commands" permission only affects commands created by bots. "Built-in" commands like /giphy, /nick, and /me will be unaffected.

What are slashes in discord?

Slash Commands are the new, exciting way to build and interact with bots on Discord. With Slash Commands, all you have to do is type / and you're ready to use your favorite bot. You can easily see all the commands a bot has, and validation and error handling help you get the command right the first time.

Why should I use autocomplete and slash commands?

No more needing to remember ids. If you need to pick a user, a role, or a channel, you can use the autocomplete that you know and love to help. Slash Commands help you learn how to use bots without the awkward mistakes of typing the wrong command into chat, or typing it the wrong way.


Video Answer


1 Answers

This error is caused because your Discord Bot does not have permission to create commands for that server.

There is two ways to fix this.

Option 1 - In-App Authorization

You should first navigate to the Discord Developer Portal then you should click on the bot that you are getting the issue with.

You will then be prompted with this page:

Splash page for the bots Management Panel in Developer Portal

You should then click on the "OAuth" page, highlighted in red on the above screenshot.

Once you are on this page, you should find the "Default Authorization Link" setting and set it to "In-App Authorization".

Default Authorization Link setting on the OAuth Page of the Developer Portal

Once that option is selected another option will pop up asking what permissions the bot will ask the user for, you can see the screenshot below.

Scope & Bot Permission settings for Discord Bot

Select bot and application.commands then select the permissions that your bot requires.

Then save your changes. Save your changes

You will need to re-authorize your bot to the guild before it will work, you do not need to kick it - just click on your bot and click "Add to Server" and re-add it to your guild.

Option 2 - URL Generation

You should first navigate to the Discord Developer Portal then you should click on the bot that you are getting the issue with.

Once you are on that page, you should access the OAuth sub-menu titled "URL Generation" as seen below.

URL Generator

Once you are on this page, you will be presented with a similar output to Option 1, you should configure the scope to be bot and application.commands and then request permissions as your bot needs.

Note

You should use both of these with your Discord bot, you should use Option 1 to setup your in-app authorization permissions and then use Option 2 to get a URL for Discord Bot lists, etc.

like image 114
Liam Avatar answered Sep 22 '22 06:09

Liam