Update README

This commit is contained in:
2022-01-02 03:41:07 +01:00
parent 849c72552c
commit 6b357709e9

View File

@ -11,12 +11,12 @@
Type /remind in a Discord server where this bot exists to get a list of slash commands you can use. Type /remind in a Discord server where this bot exists to get a list of slash commands you can use.
## Environment Variables | Environment Variable | Description |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
* `BOT_TOKEN` - Discord bot token ([Where to get one](https://discord.com/developers/applications)) | BOT_TOKEN | [Discord bot token](https://discord.com/developers/applications) |
* `TIMEZONE` - Your time zone. You want the TZ database name. ([List of time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)). Defaults to `Europe/Stockholm` | TIMEZONE | Your time zone. You want the TZ database name. ([List of time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) |
* `SQLITE_LOCATION` - (Optional) Where to store the database. Defaults to `/jobs.sqlite` | SQLITE_LOCATION | (Optional) Where to store the database. Defaults to `/jobs.sqlite` |
* `LOG_LEVEL` - Can be CRITICAL, ERROR, WARNING, INFO, or DEBUG. Defaults to `INFO` | LOG_LEVEL | Can be CRITICAL, ERROR, WARNING, INFO, or DEBUG. Defaults to `INFO` |
## Installation ## Installation
@ -24,20 +24,24 @@ You have two choices, [install directly on your computer](#Install-directly-on-y
### Install directly on your computer ### Install directly on your computer
* Install latest version of [git](https://git-scm.com/), [Python](https://www.python.org/) and [Poetry](https://python-poetry.org/docs/#installation). - Install latest version of [git](https://git-scm.com/), [Python](https://www.python.org/) and [Poetry](https://python-poetry.org/docs/#installation).
* Download project from GitHub and change directory into it. - Download project from GitHub and change directory into it.
* Open terminal in the repository folder. - Open terminal in the repository folder.
* Install requirements: - Install requirements:
* `poetry install` - `poetry install`
* Rename .env.example to .env and fill it out. - Copy .env.example from extras and rename to .env and fill it out.
* Start the bot: - Start the bot with:
* `poetry run bot` - `poetry run bot`
## Docker ## Docker
### docker-compose with .env file - Install latest version of [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/install/).
- Download project from GitHub and change directory into it.
More information on [Docker Hub](https://hub.docker.com/r/thelovinator/discord-reminder-bot) - Copy .env.example from extras and rename to .env and fill it out.
- Start the bot with, press ctrl+c to stop it:
- `docker-compose up`
- Run in the background with:
- `docker-compose up -d`
```yaml ```yaml
version: "3" version: "3"
@ -59,34 +63,8 @@ volumes:
data_folder: data_folder:
``` ```
### docker cli
```console
docker run -d \
--name=discord-reminder-bot \
-e BOT_TOKEN=JFIiasfjioFIAOJFOIJIOSAF.AFo-7A.akwFakeopfaWPOKawPOFKOAKFPA \
-e TIMEZONE=Europe/Stockholm \
-e LOG_LEVEL=INFO \
-e SQLITE_LOCATION=/data/jobs.sqlite \
-v /path/to/data:/home/botuser/data/ \
--restart unless-stopped \
thelovinator/discord-reminder-bot
```
> **_NOTE:_** SQLITE_LOCATION must be on a volume to keep the reminders if you restart the Docker container!
## Docker Environment Variables
| Parameter | Function |
| :------------------------------------------------------------------------: | ----------------------------------------------------------------------------------- |
| `-e BOT_TOKEN=JFIiasfjioFIAOJFOIJIOSAF.AFo-7A.akwFakeopfaWPOKawPOFKOAKFPA` | Discord bot token ([Where to get one](https://discord.com/developers/applications)) |
| `-e TZ=Europe/London` | Your time zone. Select yours from TZ database name. ([List of time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)). |
| `-e SQLITE_LOCATION=/home/botuser/data/` | Where to store the database file. It should be stored on a volume. |
| `-e LOG_LEVEL=INFO` | Log severity. Can be CRITICAL, ERROR, WARNING, INFO or DEBUG. |
| `-v /path/to/data:/home/botuser/data/` | Folder to store the database |
## Help ## Help
* Email: tlovinator@gmail.com - Email: tlovinator@gmail.com
* Discord: TheLovinator#9276 - Discord: TheLovinator#9276
* Steam: [steamcommunity.com/id/TheLovinator/](https://steamcommunity.com/id/TheLovinator/) - Steam: [steamcommunity.com/id/TheLovinator/](https://steamcommunity.com/id/TheLovinator/)