aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 219c6d6f709bc16ae9d734b862d99d3131ea99ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<h1 align="center">
  DisArchive<br>
</h1>

<h3 align="center">
    Discord message archiver
</h3>

<p align="center">
  <a href="https://github.com/Rapptz/discord.py/">
     <img src="https://img.shields.io/badge/discord-py-blue.svg" alt="discord.py">
  </a>
  <a href="https://github.com/psf/black">
    <img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code Style: Black">
  </a>
  <a href="https://makeapullrequest.com">
    <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg">
  </a>
</p>

## Overview

A *very* simple tool to archive messages and attachments from Discord channels. Downloads all message attachments as well as the message content and data into a SQLite/MySQL/PostgreSQL database.

## Self-host
To run DisArchive, follow the steps below.

1. Install Python 3 and Pip
2. Clone this repository
3. Install the requirements with `pip install -r requirements.txt`
4. Configure the `config.yaml` file with required information (more below)
5. Run `bot.py`

## Configuration

> [!NOTE]
> If a configuration option is labeled as optional, do not just use an empty value for that field, remove the field entirely from the config file.

### GENERAL | REQUIRED
Field | Description | Requirement
--- | --- | ---
TOKEN |`STRING`: The token for your bot. Create a bot at [discord.com/developers](https://discord.com/developers) | **REQUIRED** - *message content intent is REQUIRED*
NAMING_SCHEME | `STRING`: File naming scheme for downloaded attachments | **OPTIONAL** - *Default: `random`*
BOT_COLOR | `HEX CODE`: Color that will be used for message embeds | **OPTIONAL**

### SQLITE | OPTIONAL
Field | Description | Requirement
--- | --- | ---
NAME | `STRING`: Name of the SQLite database file | **OPTIONAL** - *Default: `disarchive.db`*

### MYSQL / POSTGRESQL | OPTIONAL
Field | Description | Requirement
--- | --- | ---
NAME | `STRING`: Name of the MySQL/PostgreSQL database | **OPTIONAL** - *Default: `disarchive`*
HOST | `STRING`: Hostname of the MySQL/PostgreSQL server | **OPTION** - *Default: `localhost`*
PORT | `INT`: Port of the MySQL/PostgreSQL server | **OPTIONAL** - *Default: `3306` for MySQL, `5432` for PostgreSQL*
USER | `STRING`: Username for the MySQL/PostgreSQL server | **REQUIRED**
PASSWORD | `STRING`: Password for the MySQL/PostgreSQL server | **REQUIRED**

<br>