This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters