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

# Connect your Discord bot

> Make a bot on Discord and connect it to DogeBot.

To build a Discord bot, you first need a **bot account** from Discord. Discord gives you one for free. It takes about 5 minutes.

<Warning>
  In these steps you will get a **token**. A token is the secret password of your bot. Never share it with anyone, never post it in a chat and never show it in a video.
</Warning>

## Part 1: Make the bot on Discord

<Steps>
  <Step title="Open the Discord Developer Portal">
    Go to **discord.com/developers/applications** and sign in with your Discord account.
  </Step>

  <Step title="Make a new application">
    Press **New Application** at the top right. Type a name for your bot (you can change it later), tick the box and press **Create**.
  </Step>

  <Step title="Open the Bot page">
    On the left, press **Bot**. Here you can change your bot's picture and name.
  </Step>

  <Step title="Turn on the intents">
    Scroll down to **Privileged Gateway Intents** and turn on all three switches:

    * **Presence Intent**
    * **Server Members Intent** (needed for join and leave events)
    * **Message Content Intent** (needed to read messages)

    Press **Save Changes**.
  </Step>

  <Step title="Copy the token">
    Still on the Bot page, press **Reset Token**, then **Yes, do it!**. Press **Copy**. Keep it safe for a minute, you need it in Part 2.
  </Step>
</Steps>

## Part 2: Connect it to DogeBot

<Steps>
  <Step title="Add the bot in DogeBot">
    In your DogeBot dashboard, open the **bot picker** at the top of the sidebar and press **Add new bot**.
  </Step>

  <Step title="Paste the token">
    Paste the token you copied and press the button to connect. DogeBot checks the token and shows your bot's name and picture.
  </Step>

  <Step title="Start your bot">
    On the **Dashboard** page you see your bot with **Online** or **Offline** next to its name. If it says Offline, press the start button.
  </Step>
</Steps>

## Part 3: Invite the bot to your server

A bot can only work in servers it has joined.

<Steps>
  <Step title="Make an invite link">
    Back in the Discord Developer Portal, open your application and press **OAuth2** on the left. Under **OAuth2 URL Generator**, tick **bot** and **applications.commands**.
  </Step>

  <Step title="Pick the permissions">
    A new box with permissions appears. The easiest choice is **Administrator**. If you want to be careful, only tick what your bot needs, like **Send Messages**, **Manage Roles** and **Read Message History**.
  </Step>

  <Step title="Use the link">
    Copy the link at the bottom, open it in your browser, pick your server and press **Authorize**.
  </Step>

  <Step title="Done!">
    Your bot is now in your server. Time to [build your first command](/getting-started/your-first-command)!
  </Step>
</Steps>

<Info>
  If you want your bot to give roles, drag the bot's role **above** the roles it should give. You do this in Discord under **Server Settings**, then **Roles**. A bot can never give a role that is higher than its own.
</Info>


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