# Add Bot to Server

## Creating Discord Bot Application

Go to the [Discord Developer portal](https://discord.com/developers/applications).

{% embed url="<https://discord.com/developers/applications>" %}

After you've logged in, click on the **New Application** button.

Here you can set some cool the name for your application, like Dark Lord or *Bastion!* You can also set a neat avatar for your bot that will be displayed to everyone in Discord.

<figure><img src="https://2090128309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LKg6aQ3L4kyoODrZlxA%2Fuploads%2Fl3xuE40uzwFP2UGA1wo5%2Fimage.png?alt=media&#x26;token=16373dc5-c0f1-4ea6-8dc7-d2b87a3060d6" alt=""><figcaption></figcaption></figure>

After you are done with customizing your Discord application, you will need to create a bot that will be associated with that application. To do that, go to the **Bot** tab in the left sidebar and then click on the **Add Bot** button to give your application a visible life in Discord.

After you create a bot, you will find a few more options in there.

Make sure to disable the **Public Bot** and **Requires OAuth2 Code Grant** options and enable the **Presence Intent**, **Server Members Intent** and **Message Content Intent** options.

<figure><img src="https://2090128309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LKg6aQ3L4kyoODrZlxA%2Fuploads%2Fu8V783gP6SCG3DbMZvbd%2Fimage.png?alt=media&#x26;token=e5cdaa1a-3c85-403c-a9b9-6b1e7293e38e" alt=""><figcaption><p>Disable the <strong>Public Bot</strong> and <strong>Requires OAuth2 Code Grant</strong> options.</p></figcaption></figure>

<figure><img src="https://2090128309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LKg6aQ3L4kyoODrZlxA%2Fuploads%2FILJi2F6NvHNFqj5a61Vg%2Fimage.png?alt=media&#x26;token=7fb4e6eb-79f4-4d4a-bb75-5bd77e59f464" alt=""><figcaption><p>Enable the <strong>Presence Intent</strong>, <strong>Server Members Intent</strong> and <strong>Message Content Intent</strong> options.</p></figcaption></figure>

## Inviting your Bot to Discord

You will need your bot's **Client ID** (remember?) during this step.

Copy the following link, and replace the `INSERT_APP_ID_HERE` in the URL with your bot's **Application ID** and paste the link in your browser and follow the instructions.

```diff
https://discord.com/oauth2/authorize?client_id=INSERT_APP_ID_HERE&scope=bot&permissions=8
```

You will be asked by Discord to select the server where you want to invite your bot. Select your server and invite your bot!

<figure><img src="https://2090128309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LKg6aQ3L4kyoODrZlxA%2Fuploads%2FlnSYslWOMutHKPyuUoWs%2Fimage.png?alt=media&#x26;token=00242479-806e-4722-877b-329e36870752" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can only invite bots to the servers where you have the **Manage Server** permission. Members with **Administrator** permission have every permission in the server. So, if you have that, it will do fine.
{% endhint %}

Now go and check out your server and you will find that your bot has joined your 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://bastion.gitbook.io/docs/prerequisites/create.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.
