NUOVO 📢 Risparmia fino al 30% sul tuo primo mese, offerta a tempo limitato!

How to create a Discord bot and get its token

Discord bot hostingUpdated Oct 6, 20263 min read

Every Discord bot starts as an application in the Discord Developer Portal. This takes about five minutes and costs nothing. Hosting it so it stays online is the next step.

Create the application and the bot

  1. Go to the Discord Developer Portal and sign in with your Discord account.
  2. Click New Application, give it a name and accept the terms. The name is what people see when they add your bot.
  3. Open Bot in the left menu. The bot is created with the application.
  4. Under Token, click Reset Token and confirm. Copy the token now. Discord shows it once; if you lose it you reset it again and the old one stops working.

The token is the bot's password. Do not post it in chat, a screenshot or a public repository. See How to keep your Discord bot token safe.

Turn on the intents your bot needs

On the same Bot page, Privileged Gateway Intents are off by default:

  • Message Content Intent: needed if your bot reads the text of messages (for example a prefix command like !ping). Slash commands do not need it.
  • Server Members Intent: needed to list or track members, or to react when someone joins.
  • Presence Intent: needed to see who is online or what they are playing.

Turn on only what your code uses. If the bot logs in and then stops with a message about disallowed intents, see Fix "Used disallowed intents" on your Discord bot.

CREA IL TUO SERVER DI GIOCO
PRONTO A INIZIARE?

Risparmia fino al 30% sul tuo nuovo server di gioco.
Prestazioni premium, attivazione immediata e affidabilità imbattibile a un prezzo migliore.

ULTIMI ARTICOLI