> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord Bot - How do I link my account?

## Overview

To authenticate with the Discord API via Nango, you will need:

1. **Bot Token** – Your Discord bot's token from the Discord Developer Portal.

This guide walks you through creating a Discord application with a bot and getting your **Bot Token**.

### Prerequisites

* A Discord account.

### Instructions

#### Step 1: Creating a Discord application and bot

1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) and sign in.
2. Click **New Application**, give it a name, and click **Create**.
3. In the left sidebar, go to the **Bot** tab.
4. Click **Reset Token**, then confirm. Discord displays your **Bot Token** once.
5. Copy the token and store it securely. If you lose it, you can reset it again, which invalidates the previous token.

<img src="https://mintcdn.com/nango/lME8R2eryHWIgfsw/api-integrations/discord-bot/discord-developer-portal-bot-token.png?fit=max&auto=format&n=lME8R2eryHWIgfsw&q=85&s=d8a2136f7d42423328b84f524e2aa74f" alt="Discord Developer Portal Bot tab with the Reset Token button" width="3456" height="1995" data-path="api-integrations/discord-bot/discord-developer-portal-bot-token.png" />

<Note>
  If your bot needs privileged gateway intents (Presence, Server Members, or Message Content), enable them in the **Bot** tab under **Privileged Gateway Intents**.
</Note>

#### Step 2: Inviting the bot to a server

To call API endpoints that operate on a server (guild), the bot must be a member of it:

1. In the left sidebar, go to **OAuth2**.
2. Under **OAuth2 URL Generator**, select the `bot` scope and the permissions your bot needs.
3. Open the generated URL in your browser and select the server to add the bot to.

#### Step 3: Enter credentials in the Connect UI

Once you have your **Bot Token**:

1. Open the form where you need to authenticate with Discord Bot.
2. Enter your **Bot Token** in its respective field.
3. Submit the form, and you should be successfully authenticated.

<img src="https://mintcdn.com/nango/lME8R2eryHWIgfsw/api-integrations/discord-bot/connect-ui.png?fit=max&auto=format&n=lME8R2eryHWIgfsw&q=85&s=eaab17d855208ded0c30d6b2d6a6ce6f" alt="Nango Connect UI for Discord Bot with the Bot Token field and Connect button" style={{maxWidth: "450px" }} width="3456" height="1993" data-path="api-integrations/discord-bot/connect-ui.png" />

You are now connected to Discord.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.