# Standard Practices

## OAuth2 Code Grant

Inviting your bot is usually quite easy, although sometimes you may receive an error regarding "Bot requires a code grant." This is due to the "Requires OAuth2 Code Grant" setting enabled. You can fix this by doing the following:

1. Go to the [<mark style="color:blue;">**Discord Developer portal**</mark>](https://discord.com/developers) and select your bot's application.
2. Under your bot's application, go to the **Bots** tab.
3. Under the **Bots** tab, look underneath **Authorization Flow** and locate **REQUIRES OAUTH2 CODE GRANT**.
4. Disable **OAUTH2 CODE GRANT**.&#x20;
5. Retry inviting your Discord bot.

![](https://1937909199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lm_hW5MApY3J0lRhi0M%2Fuploads%2FP2VFQuddo1r44298Ps91%2Fimage.png?alt=media\&token=4f96c72e-a7f8-449a-a278-ca181f0e2c1d)

![](https://1937909199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lm_hW5MApY3J0lRhi0M%2Fuploads%2FQXNoiwpDGE9prPBm0YkU%2Fimage.png?alt=media\&token=c3b43469-4388-4088-b7c8-82f86c687f65)

## Privileged Gateway Intents

Gateway intents are very important for your bot to function. Intents are required by some BotGhost modules. Intents allow us to choose which events their bot receives based on the data it needs to function, so it is best to enable the intents ahead of time to avoid future errors. If your announcement module, autoresponder module, etc. is not functioning correctly, follow the steps below:

1. Go to the [<mark style="color:blue;">**Discord Developer portal**</mark>](https://discord.com/developers) and select your bot's application.
2. Under your bot's application, go to the **Bots** tab.
3. Under the **Bots** tab, look underneath **Privileged Gateway Intents** and enable all the following three: Presence Intent, Server members Intent, & Message Content Intent.

![](https://1937909199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lm_hW5MApY3J0lRhi0M%2Fuploads%2F6a5ofrtRDYkq9fSiBDZQ%2FStep%2011.png?alt=media\&token=b1b9f62a-94f1-4bff-a3da-3b4345c5e421)

## Changing Your Bots Name

If you are unhappy with your bot's username, you can always change it through BotGhost's dashboard. You can do this by doing the following steps:

1. Go to the [<mark style="color:blue;">**BotGhost Dashboard**</mark>](https://botghost.com/dashboard)<mark style="color:blue;">**.**</mark>&#x20;
2. On the dashboard, go to the [<mark style="color:blue;">**settings page**</mark>](https://dashboard.botghost.com/dashboard/settings)<mark style="color:blue;">**.**</mark>&#x20;
3. On the first section of the bot settings, you can change the bot's name. *Remember to click "Save"!*

![](https://1937909199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lm_hW5MApY3J0lRhi0M%2Fuploads%2Fm7pEO2h84gKwTMj0C0ER%2Fimage.png?alt=media\&token=a3b69e18-a25d-4b53-8374-72d4ed1a51c0)

## Changing Your Bots Avatar

If you are unhappy with your bot's avatar, you can always change it through BotGhost's dashboard. You can do this by doing the following steps:

1. Go to the [<mark style="color:blue;">**BotGhost Dashboard**</mark>](https://botghost.com/dashboard)<mark style="color:blue;">**.**</mark>&#x20;
2. On the dashboard, go the [<mark style="color:blue;">**settings page**</mark>](https://dashboard.botghost.com/dashboard/settings)<mark style="color:blue;">**.**</mark>&#x20;
3. On the second section of the bot settings, you can change the bot's avatar. *Remember to click "Save"!*

![](https://1937909199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lm_hW5MApY3J0lRhi0M%2Fuploads%2Fez7y5vGMiVusJQKeJps4%2Fimage.png?alt=media\&token=7ba410bd-cceb-402a-a4fd-39f4603a3a8a)

## Restarting Your Bot

Your bot may need to restart your bot to have your bot function due to some unexpected errors. You can restart your bot by doing the following steps:

1. Go to the [<mark style="color:blue;">**BotGhost Dashboard**</mark>](https://botghost.com/dashboard)<mark style="color:blue;">**.**</mark>&#x20;
2. On the dashboard, go the [<mark style="color:blue;">**settings page**</mark>](https://dashboard.botghost.com/dashboard/settings)<mark style="color:blue;">**.**</mark>&#x20;
3. On the sixth section of the bot settings, you can restart your bot. Press the button **Restart Bot**. *Remember to click "Save"!*

![](https://1937909199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lm_hW5MApY3J0lRhi0M%2Fuploads%2FBeE6D4NYMIQePbF0l8WX%2Fimage.png?alt=media\&token=95c3adb1-5607-4572-83c0-a121ea41b80a)
