# Setup

## 1. Creating Discord Bot

1. Go to [**Discord Developer Portal**](https://discord.com/developers/applications)
2. Create New Application&#x20;
3. Select "Bot" from the left side menu and then choose the option to add a new bot<br>

   <figure><img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2FfIZq9RwTd0qdf3hPeHKM%2Fimage.png?alt=media&#x26;token=d1015335-004c-4d32-a573-13d76077e234" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2FCLi05O3cLz3KlcvkJulr%2Fimage.png?alt=media&#x26;token=ecb0e326-0118-4707-8790-67d6b4eb1e73" alt=""><figcaption><p><br></p></figcaption></figure>

   Make Sure to Enable **Message Content Intent** <br>

   <figure><img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2FVmuVPP6TQ7GC2ENAYJLc%2Fimage.png?alt=media&#x26;token=ff43cfe1-d46c-4ee8-8fbf-01002b0c92fa" alt=""><figcaption><p><br></p></figcaption></figure>
4. Copy Bot Token by clicking on Copy and Paste that in <mark style="color:blue;">**Config.BotToken**</mark>
5. To invite the bot into your server, go to OAuth2 and select URL Generator. Then, choose "Bot" and "Administrator" from the menu, copy the bot invite link, paste it into your browser, and invite the bot to your Discord server where you want the command bot script to work

   <figure><img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2FEJwinC8blt7JXTBtCEPS%2Fimage.png?alt=media&#x26;token=0fd42815-7eef-4d3a-8084-091f073f24ee" alt=""><figcaption></figcaption></figure>
6. Make sure you give the bot admin permissions so it can respond to your commands

## 2. Setting Script Config

1. To set up your command channel, select it from your Discord server and generate a webhook link. Then, copy the link and paste it into the <mark style="color:blue;">**Config.WebHook**</mark> section.
2. If you haven't already enabled **Developer Mode** in your Discord settings, do so now. Then, copy the ID of the channel where you set up the webhook earlier, and paste it into the <mark style="color:blue;">**Config.ChannelID**</mark> section&#x20;
3. <img src="https://1034396727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXIsRWbAXJHBnjtE4Gxk%2Fuploads%2FGtjqhNwUgnaof2UmV6X9%2Fimage.png?alt=media&#x26;token=3e73ee72-05c9-44fe-9d66-bdf011ade822" alt="" data-size="original">
4. Now To get your Guild ID, right-click on your Discord server and select 'Copy ID.' Then, paste the ID into the <mark style="color:blue;">**Config.GuildId**</mark> section
5. Edit <mark style="color:blue;">**Config.ReplyUserName**</mark> to change Bot Username
6. Add Bot Avatar URL in <mark style="color:blue;">**Config.AvatarURL**</mark>
7. Bot Command Prefix can be edited in <mark style="color:blue;">**Config.Prefix**</mark>
8. Add your commands and role into <mark style="color:blue;">**Config.RestrictCommand**</mark> to restrict commands to specific roles
