Files
admin 4819bdb70e Initial commit: Telegram monitoring bot with external configuration
- Externalize configuration to YAML (config_example.yaml)
- Add config loader with validation in bot.py
- Implement DatabaseManager for activity logging and user stats
- Add message handlers with topic awareness
- Include setup_venv.sh for automated environment setup
- Add requirements.txt with dependencies (python-telegram-bot, PyYAML)
- Comprehensive README with setup and configuration instructions
2026-06-09 19:32:07 +02:00

55 lines
1.2 KiB
Markdown

# LoggingBot
Kurze Anleitung zum Einrichten und Starten des Bots.
Voraussetzungen:
- Python 3.8+
- `git` (optional)
## Schnellstart
### 1. Virtuelle Umgebung anlegen und aktivieren
```bash
python3 -m venv .venv
source .venv/bin/activate
```
### 2. Abhängigkeiten installieren
```bash
pip install --upgrade pip
pip install -r requirements.txt
```
### 3. Konfiguration erstellen
Kopiere `config_example.yaml` zu `config.yaml` und passe die Werte an:
```bash
cp config_example.yaml config.yaml
```
Öffne `config.yaml` und ersetze:
- `YOUR_BOT_TOKEN_HERE` mit deinem echten Telegram Bot Token
- Optional: Passe `debug_mode`, `database.name` und andere Einstellungen an
### 4. Bot starten
```bash
python bot.py
```
## Konfiguration
Die Konfiguration erfolgt über die Datei `config.yaml`:
- **bot.token**: Dein Telegram Bot Token (von BotFather)
- **bot.debug_mode**: Debug-Ausgaben aktivieren (true/false)
- **database.name**: SQLite-Datenbankdatei
- **logging.write_to_file**: Aktiviere Datei-Logging (true/false)
- **logging.file_name**: Name der Protokolldatei
- **logging.level**: Python Logging Level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
Optional: Ein kurzes Setup-Skript ist enthalten: `setup_venv.sh`.