Discord bots2 minutes to read

Why is my Discord slash command missing?

Use the /ping starter to distinguish a failed bot login, a missing application command and an interaction that receives no reply.

Establish which bot is under test

Suppose Console shows a running process, but typing /ping in Discord brings up another bot’s command, or nothing at all. Before changing permissions, identify the application installed in the test server and the application that issued your deployment token. Two apps can have similar names. Compare their application IDs in Discord.

If your own project has many commands, start with a disposable test application and the slash-command quickstart. Its only expected interaction is a pong response. This gives you one specific command to trace from registration to reply.

Find the last successful startup step

Restart once, then read Console from that start. A missing file or dependency stops the program before it contacts Discord. Check the entry path and dependency manifest in Files. For a JDA project, confirm you uploaded the runnable JAR produced by the build. If login fails, check the token field, especially after resetting the token or switching applications.

The discord.js starter asks Discord to create /ping after it signs in. If Console says Could not register /ping, the token worked. Check the application installation and its command permissions, then restart to retry registration.

Check installation and command visibility

In the Discord application settings, review the server installation scopes. Use bot and applications.commands for this example. Make sure the installation belongs to your test server, then inspect command access in the server’s integrations settings and the member’s channel permissions. Use a channel where the tester can invoke application commands.

The starter registers a global command. Give Discord time to show the new registration. Look up the application in the command picker and confirm the selected command belongs to it. Enabling message-content access changes what gateway events a bot can read. The example’s slash command works with the guilds intent.

Follow one interaction through the handler

If the command appears but times out, registration has already worked. Stop any second copy of the bot running on your laptop, invoke the command once and watch the new Console output for handler errors. For a modified bot, log the command name at the start of the handler and a short success message after awaiting its reply. Keep tokens and interaction payloads out of the log.

For a final check, change the response text in your test copy, deploy that revision, and invoke the same command again. Seeing the new text ties the Discord response to the code that is actually running.