Discord basics
Slash commands vs prefix commands on Discord
Slash commands are built into Discord; prefix commands are typed messages like !help. Compare how they work, their trade-offs and which to use.
Slash commands are commands you pick from a menu after typing /, built into Discord and registered by each bot. Prefix commands are ordinary messages that begin with a special character, such as !help or .help, which the bot reads and interprets itself. Slash commands are discoverable and structured; prefix commands are fast to type and work in text chat flow.
How do slash commands work?
A bot registers its commands with Discord using the applications.commands scope. Discord then shows them in the command picker with names, descriptions and typed options (text, number, user, channel, role). When you submit one, Discord validates the options and sends the bot an interaction. The bot has to respond within a few seconds. Slash commands appear only if the bot was invited with the scope; see how to add a bot. Discord's application commands docs describe the details.
How do prefix commands work?
The bot listens to every message in channels it can see and checks whether the text starts with its prefix. If it does, the bot parses the rest itself. Because the bot has to read message text, it needs the Message Content privileged intent. See gateway intents.
Slash commands vs prefix commands
| Slash commands | Prefix commands | |
|---|---|---|
| Discovery | Shown in a menu with descriptions | You must know the command name |
| Options | Typed, validated by Discord | Parsed by the bot |
| Permissions | Server admins can restrict in Discord's integration settings | Controlled by the bot |
| Message Content intent | Not needed | Needed |
| Typing speed | Slightly slower | Very fast |
| Conflicts | Namespaced per bot | Prefixes can clash between bots |
Which should you use?
Slash commands are the better default for new users because they explain themselves, validate input and work without the Message Content intent. Prefix commands suit power users who know the commands, and they can be quicker for things like .skip in a music session. Many bots, including Based, support both.
Common mistakes
- Slash commands not showing up. The bot was invited without
applications.commands, or you lack permission to use commands in that channel. - Prefix command ignored. The bot may not be able to read that channel, may use a different prefix, or the command is restricted to certain roles.
- Two bots with the same prefix. Both respond to the same command. Change one bot's prefix if it allows.
Doing this with Based
Based supports both. Every slash command also works as a prefix command: /play and .play do the same thing. The default prefix is "." and server admins can change it to between 1 and 5 characters. Mentioning Based or replying to it starts a chat, and there is no /chat command. Use /help to see commands, or browse the full command list and commands and prefix doc. You can also restrict commands to channels and roles; see command access.
Frequently asked questions
What are slash commands on Discord?
They are commands you choose from a menu after typing a slash. Each bot registers its own, and Discord validates the options before sending them to the bot.
What is a Discord command prefix?
It is a character or short string, like ! or ., placed before a command in a normal message so the bot knows to treat it as a command.
Do prefix commands need special bot permissions?
The bot needs to see and read the channel, and it needs the Message Content intent to read the text of messages.
Can a bot support both?
Yes. Many bots offer both so new users can use the menu and experienced users can type shortcuts.
Keep learning
- Discord basics
What is a Discord bot?
A Discord bot is an automated account that runs code to respond to commands and events. Learn how bots work, what they do and how they differ from users.
- Discord basics
What are Discord gateway intents?
Gateway intents tell Discord which events a bot receives. Learn the privileged intents (Message Content, Server Members, Presence) and why they matter.
- Discord basics
How to add a bot to a Discord server
Add a bot to your Discord server with an OAuth2 invite link. Step-by-step guide covering Manage Server, scopes, permissions and common errors.
- Voice and media
How do music bots work on Discord?
How Discord music bots work: joining voice, streaming audio from sources, managing queues, and why many bots avoid YouTube. Includes common fixes.
Try it in your server
Based is an AI Discord bot in 300+ servers. Every slash command also works with the "." prefix.