Store every message of Discord servers joined by a bot in a SQLite database.
- A Discord bot
- Docker
- Docker Compose v2
- GNU make (optional)
-
Get the bot token.
-
Set
.env
file.
COMPOSE_PROJECT_NAME=reporter
COMPOSE_FILE=docker-compose.yml
BOT_TOKEN= # Discord bot token
- Build the project using either the Makefile alias or docker CLI:
$ make up-build # docker compose up --build --detach
Available options:
reporter [-h] [-d] [-f filename.db]
Discord bot to listen to server's messages.
options:
-h, --help show this help message and exit
-d, --debug display debug logs
-f filename.db, --database-file filename.db
SQLite database filename (default: 'discord.db')
Run the project:
$ make up # docker compose up --detach
Stop the project:
$ make stop # docker compose stop
Other common tasks can be found in the Makefile.
See the database diagram.
Database will be created in the logs
directory. Default database name is discord.db
. To change it, edit the command in docker-compose.yml
Example:
services:
bot:
...
command: ["reporter", "--database-file", "myfile.db"]
The file will be available at logs/myfile.db
.