---
title: "How to create your first Discord bot from scratch | StreetHosting"
description: "Beginner's guide to making a Discord bot: Developer Portal application, token, intents, a minimal-permission invite, and your first command in your server."
url: "https://streethosting.com.br/en/guides/discord-bots/create-discord-bot"
type: "page"
language: "en-US"
---

Discord Bots · 3 min · Beginner

Published on Jun 17, 2026 · Updated on Jun 17, 2026

# Create your first Discord bot

Never built a bot and not sure where to start? Here is the path from zero: create the application, get the token, invite the bot with the right permissions, and make it reply.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Getting started](https://streethosting.com.br/en/guides/topics/getting-started)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=How%20to%20create%20your%20first%20Discord%20bot%20from%20scratch&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot "Share on LinkedIn") [](https://wa.me/?text=How%20to%20create%20your%20first%20Discord%20bot%20from%20scratch%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fdiscord-bots%2Fcreate-discord-bot "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot.md)

In this guide 5 sections

* [How a bot works](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#como-funciona)
* [Create the application](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#criar-aplicacao)
* [Token and intents](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#token-e-intents)
* [Invite the bot](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#convidar)
* [Next steps](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#proximos-passos)

Quick answer

To create your **first Discord bot**, open the Developer Portal, create an application and generate the bot, copy the **token** and enable the **intents** it needs, then invite the bot with minimal permissions. Run a simple piece of code with the token and test a command. To keep it online 24/7, host it on a VPS or on a bot hosting plan.

## How a bot works[](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#como-funciona)

A Discord bot is a program that connects to the Discord API using a token, listens for events such as messages, and replies to commands. You create the bot's identity in the Developer Portal and run the code somewhere that stays on. It is the foundation of everything, from moderation bots to music bots.

## Create the application[](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#criar-aplicacao)

1. Open the Discord Developer Portal with your account.
2. Create a new application and give it a name.
3. In the bot section, generate the application's bot.
4. Set the bot's name and avatar.

## Token and intents[](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#token-e-intents)

The token is the bot's password. Whoever has the token controls the entire bot. Never post it in screenshots, commits or messages. If it leaks, generate a new one right away.

Copy the token and store it carefully. Next, enable the intents based on what the bot will do. A bot that reads messages needs the message content intent, for example. Without the right intent, the bot does not receive that event.

## Invite the bot[](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#convidar)

Generate the invite link choosing only the permissions you need and add the bot to your server. With the bot in, run a simple piece of code using the token and test a command. The natural next step is learning [slash commands](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot-slash-commands).

Start with very few permissions. It is easier to add a permission when a new feature asks for it than to find out you accidentally gave the bot too much power.

## Next steps[](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#proximos-passos)

* Token kept out of screenshots and public code
* Intents enabled according to the bot's features
* Minimal permissions in the invite
* Hosting so the bot stays online 24/7

Once the bot is replying, you still need to get it truly online. Learn how to [deploy with PM2](https://streethosting.com.br/en/guides/discord-bots/deploy-discord-bot-pm2) and how to keep [24/7 hosting](https://streethosting.com.br/en/guides/discord-bots/discord-bot-hosting-24-7) running. Check out the [bot hosting plans](https://streethosting.com.br/en/bots).

In this guide

* [How a bot works](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#como-funciona)
* [Create the application](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#criar-aplicacao)
* [Token and intents](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#token-e-intents)
* [Invite the bot](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#convidar)
* [Next steps](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot#proximos-passos)

## Frequently asked questions

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

For a bot of your own, a bit of programming helps a lot. There are libraries in many languages that make it easier. For something basic, you can start from ready-made examples and build on them little by little.

What are intents?

They are permissions that tell Discord which types of events the bot wants to receive, such as messages or members joining. Without the right intent enabled, the bot simply cannot see that type of event.

Why give the bot only the minimum permissions?

For security. A bot with more permissions than it needs becomes a risk if it is compromised. Grant only what it needs to work and expand later, when a new feature requires it.

Where does the bot run?

On your own computer it only works while the computer is on. To keep the bot online 24/7, it needs to run on a VPS or on a bot hosting plan, with automatic restart.

Next step

See bot plans

24/7 Discord bots with fast activation and support in Portuguese.

[See bot plans](https://streethosting.com.br/en/bots)

[See Ryzen VPS Ryzen 9 9950X VPS in São Paulo with root access, NVMe and gamer Anti-DDoS.](https://streethosting.com.br/en/vps/ryzen) [See Minecraft Pro Managed hosting on Ryzen with modpacks, optimized Paper and technical support.](https://streethosting.com.br/en/minecraft-pro)

## Related guides

[Discord bots Beginner How to create a Discord bot with slash commands Slash commands improve the user experience and make your bot easier to use. Here is a clear path to get started. 2 min Read guide](https://streethosting.com.br/en/guides/discord-bots/create-discord-bot-slash-commands) [Discord bots Intermediate Deploy a Discord bot with Node.js and PM2: env vars and auto restart PM2 is a popular Node process manager for Discord bots because it restarts after a crash, survives reboots when paired with the startup hook and centralizes basic logs without standing up a whole Kubernetes cluster. This guide covers the ecosystem file, env vars for the token and how it fits hosting in Brazil. 4 min Read guide](https://streethosting.com.br/en/guides/discord-bots/deploy-discord-bot-pm2) [Discord bots Beginner 24/7 Discord bot hosting in Brazil Discord bot hosting 24/7 combines a process manager with automatic restart, a token kept out of your code, logs and a server in Brazil for low latency to the API and your players. 6 min Read guide](https://streethosting.com.br/en/guides/discord-bots/discord-bot-hosting-24-7)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
