Every bot and app on Discord starts in the same place: the Discord Developer Portal. It is where you register an application, get the credentials your code uses, decide what your app is allowed to do, and produce the link people use to add it. This guide walks through the parts you will touch when building your first bot, in the order you will need them.
Applications and bots
The portal is organised around applications. An application is the identity of whatever you are building: its name, icon, description and IDs. A bot is one part of an application, the user account that joins servers and acts on your code's behalf. The same application can also handle slash commands, offer "Login with Discord" to a website, or run an Activity inside a voice channel.
Creating your first application
- Sign in at discord.com/developers/applications with your Discord account.
- Choose New Application, give it a name and accept the terms.
- On General Information, add an icon and a short description. This is what people see when they add your app, so write it for them rather than for yourself.
- Note the Application ID. Your code and your install link both use it.
The bot token
On the Bot page you can reset and copy the bot's token. The token is the password your code uses to connect as the bot, and anyone who has it can control the bot completely. Keep it in an environment variable or a secrets manager, never in your source code, and never in a public repository. If it ever leaks, reset it at once; the old token stops working immediately.
Gateway intents
Intents decide which events Discord sends to your bot. Three of them are privileged and must be switched on in the portal before your code can request them: presence updates, the server member list, and message content. Turn on only what your bot genuinely needs. Once an app grows past a certain number of servers, Discord requires verification, and privileged intents then need a reason that Discord approves.
Installing the app
The Installation page produces the link people use to add your app. For a typical bot you will want the bot and applications.commands scopes, plus the permissions the bot actually uses. Ask for the minimum. A music bot needs to connect and speak in voice channels; it does not need Administrator, and a careful server owner will notice if you ask for it. Apps can also be installed to a user's account rather than a server, which lets people use your commands anywhere on Discord.
OAuth2 and the rest of the portal
If you want people to sign in to your website with Discord, the OAuth2 page holds the client secret and the redirect URLs your site is allowed to return to. Depending on what you build, you will also use the pages for app testers, application emojis, Rich Presence art, Activities and monetization. You do not need any of them for a first bot.
Working as a team
If more than one person maintains an app, create a Team and move the application into it. Ownership then no longer depends on a single personal account, and you can decide who is allowed to see secrets and change settings.
When your app grows
A new bot can be added to servers freely at first. Once it reaches a certain number of servers, Discord asks for verification: the owner of the app, or of its team, confirms their identity, and the bot cannot be added to more servers until that is done.
At the same point, privileged intents stop being a switch you simply turn on. A verified app has to apply for each one, explain what it uses the data for, and wait for Discord to review the request. This is the main reason to request only the intents you really need from the beginning: every one of them will have to be justified later.
It also helps to keep the General Information page complete as you go, with a clear description and links to your terms of service and privacy policy. People adding your app see that information, and it saves a scramble when you apply.
Good habits from the start
- Keep tokens and client secrets out of your code and your Git history.
- Request the fewest permissions and intents that still let the app do its job.
- Use a separate test application and a private test server, so experiments never reach real users.
- Read Discord's changelog. The API changes, and apps that ignore it break.
Frequently asked questions
Is the Developer Portal free?
Yes. Creating applications and bots costs nothing. Monetization features are optional and have their own eligibility rules.
What should I do if my bot token leaks?
Reset it on the Bot page straight away. The old token stops working the moment a new one is generated, and you then update your code with the new value.
Do I need privileged intents?
Only if your bot needs the data behind them: presence updates, the full member list, or the text of messages it is not mentioned in. Most slash-command bots need none of them.
