Fix Discord Bot Slash Commands Not Showing or Working
In this article
If your Discord bot's slash commands are missing or not responding, the usual cause is that the bot hasn't been granted the applications.commands scope, the commands haven't been registered globally or to your server, or the bot lacks the necessary permissions. Here's the shortest fix: re-invite the bot with the correct OAuth2 scope (bot + applications.commands), then wait up to an hour for global commands to sync, or use a server-specific registration for instant updates. Below is the full step-by-step guide.
What You'll Need
- Access to the Discord Developer Portal (where you created the bot).
- The bot's application ID (found on the General Information page of your bot in the Developer Portal).
- Permission to manage the server (or be the server owner) to invite the bot and adjust its roles.
- If you wrote the bot's code yourself, you'll need the code editor and the ability to run the bot (or access to the hosting service).
Step-by-Step
- Check if the bot is online. Look for the bot's name in the member list of your server. If it's offline, restart the bot process (or check your hosting dashboard). Slash commands won't appear if the bot isn't connected.
- Verify the bot has the
applications.commandsscope. Go to the Discord Developer Portal, select your bot, then under OAuth2 > URL Generator, ensure bothbotandapplications.commandsare checked. If not, generate a new invite URL with both scopes, copy it, and paste it into your browser. Select your server and click Authorize. This re-invites the bot with the correct permissions. - Check if the bot was invited with the right permissions. While generating the invite URL, also scroll down to the Bot Permissions section and grant at least
Send Messages,Use Slash Commands(if shown), and any other permissions your commands need (likeManage Messagesfor moderation bots). If you already invited the bot without these, re-invite with the updated permissions. - Wait for global commands to sync. If your bot uses global slash commands (registered with
client.application.commands.set()or similar), Discord can take up to an hour to propagate them to all servers. If you just added the bot or updated commands, wait at least 60 minutes before testing. - For instant testing, register commands to a specific server. If you're developing the bot, use server-specific registration (e.g.,
guild.commands.set()in discord.js, or@app_commands.guilds()in discord.py). This makes commands appear immediately. After testing, you can switch to global commands. - Ensure the bot has the
Use Slash Commandspermission in the channel. In your server, go to Server Settings > Roles, find the bot's role, and make sureUse Slash Commandsis enabled. Also check the specific text channel's permissions (right-click channel > Edit Channel > Permissions) to ensure the bot isn't denied this permission. - Restart the bot. If the bot was running when you added the commands, a restart can help it pick up the new command definitions. Stop the bot process and start it again.
- Re-invite the bot one more time. Even if the bot is already in the server, re-inviting with the correct scopes can fix missing command registrations. Use the invite URL from step 2 and click through again.
Common Mistakes
- Forgetting the
applications.commandsscope. This is the #1 reason slash commands don't appear. The bot can be in the server but not have the ability to register commands. - Using global commands and testing too soon. Global commands can take up to an hour to appear. If you test immediately, you'll think it's broken.
- Not restarting the bot after code changes. If you added commands to the code, the bot won't know about them until you restart it.
- Putting the bot's role below the bot's own role in the role list. If the bot's role is lower than a role that denies slash commands, it can cause issues. Move the bot's role to the top of the role list.
- Using an outdated library. If you're using an old version of discord.js or discord.py, slash command support might be incomplete. Update to the latest stable version.
Tips
- Use server-specific commands during development. This avoids the hour-long wait and lets you iterate quickly.
- Check the bot's console logs. When the bot starts, it should log that commands were registered. If you see errors, fix them first.
- Test in a private server first. Create a test server with just you and the bot to avoid spamming your main server.
- If you're using a pre-made bot (like a music bot), the issue might be on the bot's side. Check the bot's support server or status page for known outages.
- Clear your Discord client cache. Sometimes the client caches old command lists. Press
Ctrl+R(Windows) orCmd+R(Mac) to reload Discord, or fully restart the app.
Troubleshooting
If the steps above didn't work, try these in order:
- Check the Discord status page. Visit status.discord.com to see if there are any ongoing API issues. If Discord is having problems, slash commands may not sync.
- Remove the bot from the server and re-add it. Go to Server Settings > Members, find the bot, click the three dots, and select Remove. Then use the invite URL from step 2 to re-add it.
- Verify your code is correct. If you wrote the bot, double-check that you're using the correct command registration method. For discord.js v14, it's
client.application.commands.set()for global orguild.commands.set()for server-specific. For discord.py, usebot.tree.sync()after defining commands. - Check if the bot is rate-limited. If you've registered commands many times in a short period, Discord might rate-limit you. Wait 10-15 minutes and try again.
- If nothing works, create a new bot application. This is a last resort. In the Developer Portal, create a new bot, copy its token, and update your code. Then invite the new bot with the correct scopes. This clears any hidden issues with the old bot's registration.
Frequently Asked Questions
Why do my slash commands show up for me but not for other users?
If you're the bot owner, you might be seeing cached commands. Other users won't see them until the commands are fully synced. Also, if you're using server-specific commands, they only appear in that server. For global commands, wait up to an hour.
My bot has the correct scopes, but commands still don't appear. What now?
Check if the bot is actually online. If it is, restart it. Then check the bot's console for any errors during command registration. If you're using a hosting service, check the logs there. If all else fails, re-invite the bot.
How long does it take for global slash commands to appear?
Discord's documentation says it can take up to an hour, but it's usually faster. If you've waited over an hour and still nothing, try re-inviting the bot or restarting it.
Can I make slash commands appear instantly?
Yes, use server-specific (guild) commands. They update instantly. For a production bot, you'd typically use global commands, but for testing, guild commands are the way to go.
My bot's slash commands work in one server but not another. Why?
This usually means the bot was invited to the second server without the applications.commands scope. Re-invite the bot to that server using the correct OAuth2 URL.
Do I need to give the bot the "Administrator" permission for slash commands to work?
No, you don't need Administrator. Just the Use Slash Commands permission (which is enabled by default) and any permissions the commands themselves need to perform actions, like Send Messages or Manage Messages.