---
title: "Get Discord Bot Token - Create App & Invite Bot | FPS.ms"
description: "Create a Discord application, get your bot token, configure permissions, and invite the bot to your server. Complete setup guide before hosting on FPS.ms."
url: https://fps.ms/docs/discord-bots/getting-your-bot-token
---
# Getting your bot token

Before you can [host your Discord bot on FPS.ms](https://fps.ms/docs/discord-bots/installation.md), 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.

!!! danger "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](https://discord.com/developers/applications)
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

!!! warning "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:

| Intent | What it does | Enable if your bot... |
|--------|-------------|----------------------|
| **Presence Intent** | Tracks user online/offline status | Shows who is online |
| **Server Members Intent** | Access to the member list | Manages roles or greets new members |
| **Message Content Intent** | Reads message text | Responds to message content (not just slash commands) |

!!! info "Slash commands don't need Message Content" "If your bot only uses [slash commands](https://fps.ms/docs/discord-bots/adding-slash-commands.md), 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:

| Permission | Use case |
|-----------|----------|
| Send Messages | Bot sends messages in channels |
| Manage Messages | Bot deletes or pins messages |
| Manage Roles | Bot assigns roles to members |
| Connect + Speak | Bot joins voice channels |
| Use Slash Commands | Bot 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**

!!! tip "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](https://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](https://fps.ms/docs/discord-bots/using-environment-variables.md).

## How to reset your token

If your token is compromised or you just need a new one:

1. Go to the [Discord Developer Portal](https://discord.com/developers/applications)
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

!!! warning "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

- [Install your bot on FPS.ms](https://fps.ms/docs/discord-bots/installation.md) — deploy with Python or Node.js
- [Set up environment variables](https://fps.ms/docs/discord-bots/using-environment-variables.md) — manage your token securely
- [Add slash commands](https://fps.ms/docs/discord-bots/adding-slash-commands.md) — make your bot interactive

---

[FPS.ms](https://fps.ms/index.html.md) · [All pages](https://fps.ms/llms.txt) · [Documentation](https://fps.ms/docs/llms.txt)
