Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Katze719 committed Apr 25, 2024
1 parent b0ef6bd commit 7624346
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 62 deletions.
83 changes: 22 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,41 @@
# SchulBot

- [bszet website](https://geschuetzt.bszet.de/index.php?dir=/Schuelerbereich/BS&sort=name)
bsz-et-2324
schulleiter#23

## Run with Docker

1. pull image
```sh
docker pull ghcr.io/katze719/schulbot:latest
```

2. run docker container with `-d`

```sh
docker run -d ghcr.io/katze719/schulbot:latest
```

## Dev Setup

1. clone project

```sh
git clone https://github.com/Katze719/SchulBot.git
```

2. cd in dir
## Run with Docker-Compose

```sh
cd SchulBot
```
```yml
version: '3'

3. create venv

```sh
python -m venv venv
services:
schulbot:
image: ghcr.io/katze719/bszet_it_bot:latest
restart: always
environment:
DISCORD_BOT_TOKEN: ${DISCORD_BOT_TOKEN}
volumes:
- ./settings:/settings
```
4. activate venv

**Windows**
```sh
.\venv\Scripts\activate
```
**macOS and Linux**
```sh
source ./venv/bin/activate
mkdir settings
docker-compose up -d
```

5. install dependencies

```sh
pip install -r requirements.txt
```
## Dev Setup

6. install poppler (preferred to use linux)
1. Setup venv

**Linux**
```sh
sudo apt-get install poppler-utils
git clone https://github.com/Katze719/BSZET_IT_BOT.git;
cd BSZET_IT_BOT;
python3 -m venv venv;
source ./venv/bin/activate;
pip install -r requirements.txt;
```

**Windows**
Download the latest Release of poppler [here](https://github.com/oschwartz10612/poppler-windows/releases)
and change the python line
```python
images = convert_from_path(f"{file_name}.pdf")
```
to
```python
images = convert_from_path(f"{file_name}.pdf", poppler_path=r'C:\path\to\poppler-23.08.0\Library\bin')
```


## How to Run the Bot
2. Run the bot

```sh
export DISCORD_BOT_TOKEN="<my token>"
python3 ./bot.py
```
2 changes: 1 addition & 1 deletion bsz_bot/helpers/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class GuildSettings:
def __init__(self, guild_id):
self.guild_id = guild_id
self.file_path = "guild_settings.json"
self.file_path = "/settings/guild_settings.json"
self.settings = {}

self.load_settings()
Expand Down

0 comments on commit 7624346

Please sign in to comment.