# OAuth2 and Invite

Now it's time to set up OAuth2 scopes and permissions so your bot can be invited to your Discord server.

1. In the Developer Portal, click the **"OAuth2"** tab in the sidebar.

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

2. In the URL Generator, under **Scopes**, select:

* `bot`
* `applications.commands`

<figure><img src="/files/2B403DiGQdVZnln9PEOL" alt=""><figcaption></figcaption></figure>

3. Under **Bot Permissions**, select:

* `Administrator`\
  (This gives the bot full control over your server, only assign it if you trust the bot and its code.)

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

4. Copy the **generated invite URL** to your clipboard.

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

Final step:

5. Paste the invite URL into your browser.
6. Choose the Discord server (guild) where you want to add the bot.
7. Click **Continue** and follow the prompts to authorize the bot.

<figure><img src="/files/M4oAH2ZewhIIEQYbQZMA" alt="" width="359"><figcaption></figcaption></figure>

<figure><img src="/files/GHzsfeqpvwOJnNrE2lJu" alt="" width="333"><figcaption></figcaption></figure>

***

That’s it! You’ve successfully created and invited your bot.

To start the&#x20;


---

# 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.guildabot.com/guilda-bot-knowledge-base/customer-guides/installation-guide/bot-token-and-intents/oauth2-and-invite.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.
