# Basic Installation

## 1. Clone repository

Go to [the Github **repository page**](https://github.com/PetyXbron/minecraft-bot) on your internet browser, and then just **clone it** to your computer, and then we will do more.\
I can recommend you use GitHub[ **Desktop**](https://desktop.github.com/). It's really easier to clone repositories from GitHub.

<div align="left"><img src="/files/-MbqHmlixRwfTAXvjU6H" alt="Clone button in repository"></div>

{% hint style="info" %}
Do you need more help? Read the [**official documentation**](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository#cloning-a-repository-using-the-command-line) about cloning repositories.
{% endhint %}

## 2. Install Visual Studio Code

Install [**Visual Studio Code**](https://code.visualstudio.com/download) by Microsoft, or any other code program.\
It will be better for you to control the code.

{% hint style="info" %}
**If you don't want to install code programs, you can just edit the config.js file in a text editor. It will be less clear, but still sufficient.**
{% endhint %}

## 3. Create a discord bot (application)

{% hint style="info" %}
I can recommend [**this documentation**](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token) for creating a discord application by [Edward Jones](https://github.com/Throne3d).
{% endhint %}

### 1. Go to the [Discord Developers website](https://discord.com/developers/applications), where you have your applications (projects).

We will create a new app (project) here.

### 2. Click the blurple button in the upper right corner with the name "New Application".&#x20;

<div align="left"><img src="/files/-MeBJTTDAvLfs_0UPEva" alt=""></div>

In the new pop-up, enter your app name (not the name of your future bot)\
After creating, you can add an avatar/icon of your app (you don't have to, actually)

### 3. Create a bot&#x20;

Go to page "**Bot**"

<div align="left"><img src="/files/-MeBK1TKuiAcZXO65nVV" alt="Application schema"></div>

On the "**Bot**" page, **click the blurple button** with the name "**Add Bot**".

<div align="left"><img src="/files/-MeBKLsTGsDviAupA_Dh" alt=""></div>

{% hint style="info" %}
If you want, you can now change the name and avatar of your true bot.
{% endhint %}

We did this step because you can now get the token of your bot on the "**Bot**" page.

## 4. Customize your config

It's time to change the config data.\
**Go to the folder** you downloaded and **open the file** **config.js**.\
[/*minecraft-bot/config.js*](https://github.com/PetyXbron/minecraft-bot/blob/main/config.js)

{% hint style="info" %}
You can open this file with your code editor (like visual studio code) or any of the text editors.\
You won't have it clear (colorful) but it's time-saving.
{% endhint %}

Now, let's edit the data in our config. You need to modify the information about the bot and server.\
If you want, you can edit also embeds, commands aliases, \
auto-changing status message (statusCH) settings, and more.

{% hint style="info" %}
If you don't understand some data, you can check out the [**Config data**](/1.8/installation/config.md) page.
{% endhint %}

## 5. Install the dependencies

You need to install dependencies to have the code working.\
Install them with the command **`npm install`**.

{% hint style="info" %}
In [**Visual Studio Code**](https://code.visualstudio.com/), the console opens by **`CTRL + ;`**. Commands are used there.
{% endhint %}

If you are struggling to install all the necessary packages by these two commands:

```
npm i @discordjs/builders@0.15.0 @discordjs/rest@0.5.0 discord-api-types@0.36.1 discord.js@13.8.1 fs minecraft-motd-util@1.1.12 minecraft-server-util@5.2.10 ms@2.1.3
npm i chalk@4.1.2 quick.db@7.1.3 --save --save-exact
```

## 6. Run the bot

Well done! You are at the last step now.\
You need to start the code. You can run it with the command **`npm start`** or **`node index.js`**.

{% hint style="info" %}
If you have a mistake in the config file, you should get a warning in the console.
{% endhint %}

{% hint style="info" %}
If you don't understand something, you found a bug, or you just need help\
creating[ **a new issue**](https://github.com/PetyXbron/minecraft-bot/issues/new) on [the GitHub repository](ttps://github.com/PetyXbron/minecraft-bot) page.
{% endhint %}

### How to invite the bot to the server?

The answer is on the **FAQ** [here](/1.8/faq.md#how-to-invite-the-bot-to-my-discord-server).


---

# 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://mb.petyxbron.cz/1.8/installation/install.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.
