# Bot Setup

## 1. Creating a Bot

1. Navigate to [Discord Developer Portal - My Applications](https://discord.com/developers/applications)
2. Click "New Application" and type a meaningful name
3. On the sidebar, navigate to the "Bot" tab
4. Click "Add Bot" and confirm

## 2. Generating a Token

After adding a new bot to your application, on the same page, locate the "Token" and copy it.

{% hint style="warning" %}
Do not share this with anyone, as it will give them access to do things on behalf of the bot!
{% endhint %}

![Locating, generating and copying a Bot's token](/files/-MWm-7miO0S_xUiw-Ef0)

Paste the token into the bot configuration file.

{% code title="config/chatter/discord/bot.json5" %}

```javascript
{
	// Token used to authenticate against your Discord bot
	"token": "PASTE_YOUR_TOKEN_HERE",
	// ...
}
```

{% endcode %}

## 3. Inviting to a Guild

Now that you've created your bot, it's time to invite it to your Discord server.

1. On the sidebar, navigate to the "OAuth2" tab
2. Under "OAuth2" URL Generator, tick the "bot" scope
3. A new selection of "Bot Permissions" should appear, tick all that apply
4. Go back up to the "Scopes", copy and go to the resulting URL
5. Select your Discord server, and click "Authorize"

![Generation of a recommended invite URL](/files/-MWm5tOhAttmnfxpLWnT)

## 4. Other Setup

These additional setup guides may not concern everyone. Feel free to skip over them.

{% content-ref url="/pages/-MWxkQxbDP9SIvV1j-QL" %}
[Bot Status](/chatter-for-minecraft/discord/bot-setup/status.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MWm8SuKEvSx9vRdv7rR" %}
[Server Members Intent](/chatter-for-minecraft/discord/bot-setup/server-members-intent.md)
{% endcontent-ref %}


---

# 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://axieum.gitbook.io/chatter-for-minecraft/discord/bot-setup.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.
