> For the complete documentation index, see [llms.txt](https://docs.scratch-for-discord.com/use/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scratch-for-discord.com/use/tutorial/bot.md).

# Bot Setup

Application Creation and Management

## Application Creation

1. Go to the [Discord developer portal](https://discord.com/developers/applications)
2. Click on on the top right button "New Application"

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2Fgit-blob-3ee986958e10ffdfa17269306797be5cd6934204%2Fimage.png?alt=media" alt=""><figcaption><p>Discord Developer Portal﹣"New Application" Button</p></figcaption></figure>
3. In the modal, input a name in the "name" field, then click on the button "create"

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2FeF1iLpKHXmQeAcg2H9Km%2FScreen%20Shot%202022-10-16%20at%209.38.57%20AM.png?alt=media&amp;token=5fe07a4e-9c5a-4253-bc65-ead4c4eacefc" alt="Discord Developer Portal﹣&#x22;Create an Application&#x22; Modal"><figcaption><p>Discord Developer Portal﹣"Create an Application" Modal</p></figcaption></figure>

## Application Customization

On the left, there is a sidebar menu which has an option "General Information"\
This is where you can customize the bot and add more information

<figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2FDTk7nNf1GonrUDhDwWfC%2FScreen%20Shot%202022-10-16%20at%209.52.51%20AM.png?alt=media&amp;token=5b8bfe96-9124-405d-9c7c-d351c7d50d82" alt="Discord Developer Portal﹣&#x22;General Information&#x22; Menu"><figcaption><p>Discord Developer Portal﹣"General Information" Menu</p></figcaption></figure>

## Bot Creation

1. Click on the menu "Bot"

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2FYEsaTZLYNJ4Xjsfbq8ZO%2FScreen%20Shot%202022-10-16%20at%209.59.48%20AM.png?alt=media&amp;token=5059035e-b675-4990-82c0-3e7230c7eb1b" alt="Discord Developer Portal﹣&#x22;Bot&#x22; Menu"><figcaption><p>Discord Developer Portal﹣"Bot" Menu</p></figcaption></figure>
2. Click on the far right button "Add Bot"

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2Fgit-blob-3a1c29e090d9609a7243458d13c7b8467c6cb4de%2Fimage%20(23).png?alt=media" alt="Discord Developer Portal﹣&#x22;Add Bot&#x22; Button"><figcaption><p>Discord Developer Portal﹣"Add Bot" Button</p></figcaption></figure>
3. Scroll down to the sections "Privileged Gateway Intents", and turn all of them on

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2FwujAspW4mGPvq62CzMKO%2FScreen%20Shot%202022-10-16%20at%2010.05.23%20AM.png?alt=media&amp;token=32a74e86-8918-4127-87c5-ee8662c931fb" alt="Discord Developer Portal﹣&#x22;Privileged Gateway Intents&#x22; Section"><figcaption><p>Discord Developer Portal﹣"Privileged Gateway Intents" Section</p></figcaption></figure>

{% hint style="warning" %}

### Requirement

Scratch for Discord does only work with all Privileged Gateway Intents allowed:

* PRESENCE INTENT
* SERVER MEMBERS INTENT
* MESSAGE CONTENT INTENT
  {% endhint %}

{% hint style="danger" %}

### Limitations

Once a bot exceeds 100 servers:

* An official verification from Discord is needed
  {% endhint %}

## Get the Token

1. Get the token by clicking on the button "Reset Token", then click on the button "Copy"

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2FFo7AKnXa0yw0cTxzH9nx%2FScreen%20Shot%202022-10-16%20at%2010.26.06%20AM.png?alt=media&amp;token=559484da-f4a7-4e20-be07-cbd746cf5990" alt="Discord Developer Portal﹣&#x22;Token&#x22; Page"><figcaption><p>Discord Developer Portal﹣"Token" Page</p></figcaption></figure>

{% hint style="warning" %}
It is impossible to get an already created [token](/use/toolbox/base.md#token):\
If you have lost it, you need to reset it
{% endhint %}

{% hint style="info" %}
To know how to use the [token](/use/toolbox/base.md#token), check [Base](/use/toolbox/base.md#token)
{% endhint %}

## Bot Invitation

1. Go to the sidebar menu "OAuth2", then on the sub-menu "URL generator"

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2Fgit-blob-807e0e61546362a37c108c850425815d6c45330e%2Fimage%20(22).png?alt=media" alt=""><figcaption></figcaption></figure>
2. Select the option "bot"

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2FRC0PyfgjN424O4eG8i1D%2FScreen%20Shot%202022-10-16%20at%2010.58.43%20AM.png?alt=media&amp;token=cf96b2bf-522b-4306-b862-e9b7c3d5c97c" alt=""><figcaption><p>once selected another menu will open</p></figcaption></figure>
3. Select the bot permissions you need *(recommandation: for a private bot, chose Administrator)*

   <figure><img src="https://2077548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3xg7dEw96L10OHOz0yDz%2Fuploads%2F77izM0jw96OqCO8ZAFDy%2FScreen%20Shot%202022-10-16%20at%2011.01.34%20AM.png?alt=media&amp;token=a9223eb8-7b3d-4181-bfec-3748048ba31f" alt=""><figcaption></figcaption></figure>
4. Below the permissions menu, browse to the URL
5. Invite the bot to the server you need

{% hint style="info" %}
Further information and official documentation:\
<https://discordjs.guide/preparations/setting-up-a-bot-application.html#creating-your-bot>
{% endhint %}
