# Installing and Using

{% hint style="info" %}
For this guide, we will assume installation of the original, first generation branch of Darvester which does not include an Electron and Node.js webpack.
{% endhint %}

## Requirements

* `python` 3.9 or later
* `git`
* A Discord account (preferably a burner)

## Installing

{% hint style="info" %}
As of this writing, the second generation of Darvester is still being developed which is planned to include an installer for each major operating system. For now, manual setup will be used.
{% endhint %}

### 1. Clone the repository

Using `git`, clone the repository to a desired location.

{% code lineNumbers="true" %}
```shell-session
$ git clone https://github.com/darvester/darvester
$ cd darvester
```
{% endcode %}

### 2. Set up the Python environment

This is a highly encouraged task, although it is optional. With your desired Python version, create a virtual environment within the `darvester` folder.

{% code lineNumbers="true" %}
```shell-session
$ python3.9 -m venv .venv
$ source .venv/bin/activate
```
{% endcode %}

{% hint style="info" %}
For Windows systems, the second command requires altering:
{% endhint %}

```powershell
.\.venv\Scripts\activate.bat
```

After activating the Python environment, install the requirements.

```shell-session
$ pip install -r requirements.txt
```

### 3. Configure Darvester

#### 3.1 Acquiring your Discord user token

1. Open Discord in your **web browser** and login
2. Press **Ctrl+Shift+I** (⌥⌘I on macOS) to open **developer tools**
3. Press **Ctrl+Shift+M** (⇧⌘M) to toggle **device toolbar**
4. Navigate to the **Application** tab
5. On the left, expand **Local Storage** and select **https꞉//discord.com**
6. Type `token` into the **Filter** box
7. If the **token** key does not appear, press **Ctrl+R** (⌘R) to reload
8. Copy the **value** of the token key

{% hint style="info" %}
If you're not able to find your token, view [this guide](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs#how-to-get-a-user-token) from GitHub which describes the user token process in great detail.
{% endhint %}

#### 3.2 Editing the configuration file for Darvester

Copy `cfg.py.template` to `cfg.py`.

```shell-session
$ cp cfg.py.template cfg.py
```

Paste the user token from step **3.1** into the `TOKEN` variable. Remember quotes around it!

{% code title="cfg.py" lineNumbers="true" %}
```python
from logging import CRITICAL, INFO, WARNING

TOKEN = "*discord user token here*"

...
```
{% endcode %}

This should be the bare minimum you need to run Darvester, the rest is handled automatically. Feel free to view through the other configuration variables to configure Darvester to your liking.

### 4. Running Darvester

```shell-session
$ python run.py
```

That's all folks.
