# Setting Up a Discord BOT

{% hint style="danger" %}
Be sure to follow the correct procedure when setting Gateway Intents and Permissions.
{% endhint %}

### Steps

1. Go to the official Discord Developer Portal - <https://discord.com/developers/applications>
2. Click on the <mark style="color:blue;">`New Application`</mark> and type a name for the BOT

<figure><img src="/files/ilBf7I9VN0W5QrD5G7Ov" alt=""><figcaption></figcaption></figure>

3. Next, go to the <mark style="color:blue;">`Bot`</mark> page and in the Privileged Gateway Intents allow `Server members intent` and `Message content intent`

<figure><img src="/files/LpL8WJjqNksjee7d6W23" alt=""><figcaption></figcaption></figure>

4. Next, go to the <mark style="color:blue;">`OAuth2`</mark> page&#x20;

<figure><img src="/files/IgJ8H42EFr2oYU82NA2R" alt=""><figcaption></figcaption></figure>

5. And then go to the OAuth2 URL Generator section and check `applications.commands` and `bot` in Scopes and in Bot permissions check `Administrator`

<div align="center" data-full-width="false"><figure><img src="/files/GBW8ujcUNXw9fMOEh0sQ" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/Yx1F8TbFoM0Zc1yQJFh2" alt=""><figcaption></figcaption></figure>

6. Then just copy the Generated URL and paste it into your browser to invite the bot to your Discord server.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sourcefactory.eu/discord-utilities/tutorials/setting-up-a-discord-bot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
