# 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="/files/9TtlJMTLiq6fgfftJiJz" alt=""><figcaption></figcaption></figure>

   <figure><img src="/files/Ebjk2YoX1KzCjjOaE6Gi" alt=""><figcaption><p><br></p></figcaption></figure>

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

   <figure><img src="/files/YipvwbZiggRXTS2eNIz0" 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="/files/G0P7aWVkQB38fRld6X6V" 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="/files/UE9WqI6yZaNX2S6Q23P0" 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


---

# 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://codestudio5m.gitbook.io/codestudio/our-scripts/discord2fivem-v2/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.
