Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

How to Make a Discord Bot: Developer Portal Steps (2026)

To make a Discord bot, create a new app in the Discord Developer Portal, generate its bot token on the Bot page, set its install scopes and permissions, then add it to a test server with the install link and run code that replies. The part people get wrong: the token is a password, so never share or publish it.

A Discord bot sounds like a developer-only project, but the first half of the job is filling in forms on Discord's own website. You create an app, switch on its bot user, choose what it's allowed to do and add it to a test server. The code that makes it reply comes after that, and Discord even provides a sample project to start from.

I'm writing this for community owners, coaches and small teams who want a bot that answers a slash command, welcomes members or posts reminders. Every step below follows Discord's official developer documentation, and I'll flag the one rule you must never break: keeping your bot token secret.

What a Discord bot is in Discord's developer terms

In Discord's documentation, a bot is part of an app. You create the app in the Discord Developer Portal, and new apps come with a bot user switched on by default. That bot user is what shows up in a server's member list, with its own name and avatar. Slash commands, buttons and other interactions all belong to the app.

So when people say "make a Discord bot", there are really three layers:

  • The app, created and configured in the Developer Portal.
  • The install link, which decides where the app can be added and what it's allowed to do.
  • Your code, running on a computer or server, which receives events from Discord and replies.

Creating your Discord bot app in the Developer Portal

  1. Sign in to the Discord Developer Portal with your normal Discord account.
  2. Create a new application and give it a name. You can change the name and icon later.
  3. Open the General Information page. Note the Application ID and the Public Key, because your code will need them. You'll also see a field called Interactions Endpoint URL, which you'll fill in later.
  4. Open the Bot page. This is where the bot user lives, along with settings for privileged intents and whether other people can install your bot.

Discord's getting started guide says you don't need to change the privileged intents for a simple first bot, so leave them alone until you know your bot needs them.

Getting your Discord bot token and keeping it secret

The token is the password your code uses to act as the bot. On the Bot page, click Reset Token to generate one. Discord warns that you won't be able to view the token again unless you regenerate it, so copy it straight into a safe place.

This is the bit people get wrong, so here are Discord's rules in plain terms:

  • Never share your token with anyone, including people offering to help in forums or DMs.
  • Never paste it into a chat, a screenshot, a support ticket or a public code repository. Discord says it should never be committed to version control.
  • Keep it in a private settings file on your own machine, which Discord's sample project calls an environment file.
  • If you think it has leaked, go back to the Bot page and reset it straight away. The old token stops working.

Anyone with your token can control your bot in every server it's in, so treat it like your bank PIN.

Setting install options and permissions for your Discord bot

Next, decide where your bot can be added. On the Installation page in the Developer Portal:

  1. Under Installation Contexts, choose Guild Install (servers), User Install (personal accounts), or both. Discord's guide switches both on.
  2. Under Install Link, pick Discord Provided Link.
  3. In Default Install Settings, give User Install the applications.commands scope.
  4. Give Guild Install the applications.commands and bot scopes. Choosing bot opens a permissions list.
  5. Tick only the permissions your bot needs. Discord's guide starts with Send Messages.
  6. Copy the install link.

Asking for fewer permissions is kinder to server owners and makes people more likely to trust your bot. Administrator is rarely needed and is a big red flag for anyone deciding whether to add it.

Adding your new Discord bot to a test server

Before your bot goes anywhere public, put it in a private server you control. Make a fresh server just for testing if you don't have one.

  1. Paste the install link into your browser.
  2. Choose Add to server.
  3. Pick your test server and confirm.
  4. Check the server's member list. Your bot should be there, shown offline until your code runs.

Choosing Add to my apps instead installs it to your own account, which lets you open a direct message with it.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

Making your Discord bot respond with code

At this point the bot exists but does nothing. Discord's getting started guide provides a sample project: you add your Application ID, Public Key and token to its private settings file, install its packages and run it on your computer. It registers a few slash commands and then waits for people to use them.

Because Discord needs to reach your computer, the guide uses a tunnelling tool to give your machine a temporary public web address. You paste that address, with /interactions added to the end, into the Interactions Endpoint URL field on General Information and save. If Discord can't verify the address, the guide's tip is to check that the tunnel and the app use the same port and that the address was copied correctly.

If you'd rather not code at all, plenty of existing bots can welcome members or run polls for you, and I've covered adding one in a separate guide. For a sense of what chat automation can do for a business more widely, my piece on how a WhatsApp bot can automate customer conversations is a good primer.

Keeping your Discord bot running and growing

Your bot only works while your code is running. Once you're happy with it on your laptop, you'll want to move it to a computer or hosting service that stays on. A few other things to know as it grows:

  • Verification: Discord's developer support says apps need to be verified before they can grow past a certain number of servers. You start this from the App Verification tab in the Developer Portal.
  • Privileged intents: features like reading message content or member lists need special permission, and larger bots have to apply for it.
  • Safety: review any code you copy from tutorials before running it, and never run code that asks for your personal Discord login or token.

Discord bot ideas for creators and small communities

If you're wondering what your first bot should do, start small and useful:

  • A slash command that shares your latest course link, booking page or episode.
  • A welcome message that points new members to the rules channel.
  • A daily or weekly prompt for a community challenge.
  • A simple frequently asked questions command so moderators don't repeat themselves.

For quick votes, you might not need a bot at all. If part of your audience lives on Facebook, a poll in a Messenger group chat can do the job in seconds.

Frequently asked questions

How do I make a Discord bot?

Create an app in the Discord Developer Portal, reset and save its bot token on the Bot page, set its install options and permissions, add it to a test server with the install link, then run code that responds to Discord's events.

Do I need to know how to code to make a Discord bot?

To make your own bot respond, yes, at least enough to set up and run Discord's sample project. If you'd rather not code, you can add an existing bot from Discord's App Directory instead.

Where do I find my Discord bot token?

On the Bot page of your app in the Developer Portal. Click Reset Token to generate it. Discord says you won't see it again unless you regenerate it, so store it somewhere private.

What should I do if my Discord bot token leaks?

Go to the Bot page and reset the token straight away. The old one stops working. Then update your private settings file with the new token.

Why is my Discord bot offline?

A bot only shows online while your code is running and connected. If you've closed the program or your computer is off, the bot shows offline in the member list.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.