> For the complete documentation index, see [llms.txt](https://docs.guildabot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.guildabot.com/guilda-bot-knowledge-base/customer-guides/installation-guide/bot-token-and-intents/oauth2-and-invite.md).

# 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="https://3874003203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjPvZzvaBYurYEVT2ck2f%2Fuploads%2FZhcq8U412Dm9jtGW2WzC%2Fimage.png?alt=media&amp;token=b724a819-c712-4594-a349-581ab5fc28e8" alt=""><figcaption></figcaption></figure>

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

* `bot`
* `applications.commands`

<figure><img src="https://3874003203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjPvZzvaBYurYEVT2ck2f%2Fuploads%2FSpSYBlTJ6EaXFt4xFYNw%2Fimage.png?alt=media&amp;token=6584e285-9e6a-4ec2-be71-a7fb577bb809" 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="https://3874003203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjPvZzvaBYurYEVT2ck2f%2Fuploads%2FkWjwSsqIYcPNWvfpIjNq%2Fimage.png?alt=media&amp;token=12a6f1d0-84b9-4eb3-93b1-c7d4841b0c12" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3874003203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjPvZzvaBYurYEVT2ck2f%2Fuploads%2FQPoFI9orG3J83ty9pPpC%2Fimage.png?alt=media&amp;token=9aa385a7-925d-4409-8e47-b680478a3c16" 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="https://3874003203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjPvZzvaBYurYEVT2ck2f%2Fuploads%2Fc1Sd4e8xm5QpGqBsOPeO%2Fimage.png?alt=media&amp;token=952b531a-7f4a-4ab8-a1e6-d7e4f5f75e30" alt="" width="359"><figcaption></figcaption></figure>

<figure><img src="https://3874003203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjPvZzvaBYurYEVT2ck2f%2Fuploads%2FoYpBJ6tj1KGRmnF7heoD%2Fimage.png?alt=media&amp;token=62da3334-31f4-4c91-b9c4-92ed14971895" alt="" width="333"><figcaption></figcaption></figure>

***

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

To start the&#x20;
