Discord Bots

Getting your bot token

CanerAkar Mar 17, 2026

Before you can host your Discord bot on FPS.ms, you need a bot token from Discord. This guide walks you through creating a Discord application, generating the token, setting permissions, and inviting the bot to your server.

What is a bot token?

A bot token is a unique authentication key that lets your code connect to Discord as a bot. Think of it as a password — anyone with your token can control your bot, so keep it secret.
Never share your bot token
If your token is ever exposed (in a screenshot, public GitHub repo, or message), reset it immediately in the Discord Developer Portal. Leaked tokens let others hijack your bot.

Step 1: Create a Discord application

  1. Go to the Discord Developer Portal
  2. Sign in with your Discord account
  3. Click New Application in the top right
  4. Enter a name for your application (this can be changed later)
  5. Accept the Developer Terms of Service and click Create
You are now on your application's General Information page. The application name and icon you set here appear when users interact with your bot.

Step 2: Create the bot user

  1. Click Bot in the left sidebar
  2. Your bot user is created automatically with your application
  3. Under Token, click Reset Token
  4. Click Yes, do it! to confirm
  5. Copy the token immediately — you will not be able to see it again
Copy it now
Discord only shows the token once. If you lose it, you will need to reset it and update it everywhere you use it.

Step 3: Configure bot permissions and intents

Privileged Gateway Intents

Still on the Bot page, scroll down to Privileged Gateway Intents. Enable the intents your bot needs:
IntentWhat it doesEnable if your bot...
**Presence Intent**Tracks user online/offline statusShows who is online
**Server Members Intent**Access to the member listManages roles or greets new members
**Message Content Intent**Reads message textResponds to message content (not just slash commands)
Slash commands don't need Message Content
If your bot only uses slash commands, you do not need the Message Content intent. This is the recommended approach for new bots.

Bot permissions

When generating the invite link in the next step, you will select which permissions your bot needs. Common permissions:
PermissionUse case
Send MessagesBot sends messages in channels
Manage MessagesBot deletes or pins messages
Manage RolesBot assigns roles to members
Connect + SpeakBot joins voice channels
Use Slash CommandsBot registers slash commands
Only request the permissions your bot actually uses — fewer permissions is better for security.

Step 4: Invite the bot to your server

  1. Click OAuth2 in the left sidebar
  2. Scroll down to OAuth2 URL Generator
  3. Under Scopes, check bot and applications.commands
  4. Under Bot Permissions, select the permissions your bot needs
  5. Copy the generated URL at the bottom
  6. Open the URL in your browser
  7. Select the server you want to add the bot to and click Authorize
Can't see your server?
You need the Manage Server permission on the Discord server to add a bot. If you don't see your server in the list, ask the server owner to add the bot or give you the Manage Server permission.
Your bot now appears in your server's member list (shown as offline until you start it on FPS.ms).

Step 5: Add the token to FPS.ms

Now that you have your token, add it to your FPS.ms server using a .env file:
  1. Go to panel.fps.ms and select your Discord bot server
  2. In the Files tab, create a file named .env in the root directory
  3. Add your token in the format: BOT_TOKEN=your-token-here
  4. Save the file and restart your server
For more details on managing tokens and other config values securely, see our environment variables guide.

How to reset your token

If your token is compromised or you just need a new one:
  1. Go to the Discord Developer Portal
  2. Select your application
  3. Click Bot in the left sidebar
  4. Click Reset Token and confirm
  5. Copy the new token
  6. Update the token in your .env file on FPS.ms
Updating your token
After resetting, your bot will go offline until you update the .env file on FPS.ms and restart. The old token stops working immediately.

Next steps

Was this article helpful?