1.4 KiB
1.4 KiB
Komga Manager Bot
Small vibe-coded telegram bot for uploading files into a komga instance.
- Send a document to the bot. Files are saved to
BASE_DIR/DEFAULT_SUBDIR(defaults to/data/books). - If a filename already exists, the bot appends a suffix (
_1,_2, ...). - If
KOMGA_USERandKOMGA_PASSare set, the bot will trigger Komga library scans after saving.
Environment
| Variable | Description | Default / Example |
|---|---|---|
TELEGRAM_TOKEN |
Telegram bot token (required) | |
USER_IDS |
Comma-separated allowed Telegram user IDs | 12345,67890 |
BASE_DIR |
Base path for saved files | /data |
DEFAULT_SUBDIR |
Subdirectory under BASE_DIR |
books |
KOMGA_URL |
Komga base URL | (optional) |
KOMGA_USER / KOMGA_PASS |
Komga credentials (enable rescan) |
Getting started
Docker
Build and run in background:
docker compose up -d --build
The service mounts ./data into the container at /data.
Run locally
Install dependencies and run:
pip install python-telegram-bot httpx
python bot.py
Requires Python 3.11 + pip