modified: .env.example
modified: README.md
This commit is contained in:
13
.env.example
13
.env.example
@@ -1,13 +0,0 @@
|
||||
# Discord Bot Token (wird in Coolify als Umgebungsvariable gesetzt)
|
||||
DISCORD_TOKEN=your_discord_bot_token_here
|
||||
|
||||
# Database Connection - Option 1: Full URL (PostgreSQL/MySQL)
|
||||
DATABASE_URL=postgresql://username:password@host:port/database_name
|
||||
# DATABASE_URL=mysql://username:password@host:port/database_name
|
||||
|
||||
# Database Connection - Option 2: Individual Variables
|
||||
DB_HOST=localhost
|
||||
DB_PORT=5432
|
||||
DB_NAME=hoi4_elo
|
||||
DB_USER=username
|
||||
DB_PASSWORD=password
|
||||
63
README.md
63
README.md
@@ -4,18 +4,23 @@ Ein Discord Bot für Hearts of Iron IV, der über Coolify deployed werden kann.
|
||||
|
||||
## Features
|
||||
|
||||
- **Basic Commands**: Ping, Info, Server-Informationen
|
||||
- **HOI4 Theme**: Speziell für Hearts of Iron IV Communities
|
||||
- **Docker Support**: Bereit für Deployment über Coolify
|
||||
- **Error Handling**: Robuste Fehlerbehandlung
|
||||
- **Logging**: Ausführliche Logs für Debugging
|
||||
- ELO-System (Standard/Competitive), Spiele-Lifecycle (/hoi4create, /hoi4setup, /hoi4end)
|
||||
- Stats, History und Leaderboard
|
||||
- Emoji-/Länder-Tag-Unterstützung (tags.txt, emotes.markdown)
|
||||
- Automatische Rollenvergabe nach ELO (pro Kategorie)
|
||||
- YouTube Musikplayer (yt-dlp + ffmpeg) mit Queue und Lautstärke
|
||||
- Docker/Coolify ready
|
||||
|
||||
## Verfügbare Befehle
|
||||
## Verfügbare Befehle (Auszug)
|
||||
|
||||
- `!ping` - Zeigt die Bot-Latenz an
|
||||
- `!info` - Zeigt Bot-Informationen an
|
||||
- `!help_hoi4` - Zeigt alle verfügbaren Befehle an
|
||||
- `!server_info` - Zeigt Informationen über den aktuellen Server
|
||||
- `/hoi4create <type> <name>` – Neues Spiel anlegen (type: standard/competitive)
|
||||
- `/hoi4setup <game> <user> <team> <t-level> [country]` – Spieler hinzufügen (T1/2/3; country optional als HOI4-Tag)
|
||||
- `/hoi4end <game> <winner_team|draw>` – Spiel beenden, ELO berechnen, Rollen syncen
|
||||
- `/hoi4stats [user]` – ELO, Rank, Win/Draw/Loss
|
||||
- `/hoi4history [limit] [player] [name] [type]` – Abgeschlossene Spiele filtern
|
||||
- `/hoi4leaderboard [type] [limit]` – Top ELOs
|
||||
- Musik: `/join`, `/leave`, `/play <url|search>`, `/skip`, `/stop`, `/pause`, `/resume`, `/queue`, `/np`, `/volume <0-200>`
|
||||
- Diagnose: `/webtest [query]` – Testet Web-Konnektivität und yt-dlp-Extraction
|
||||
|
||||
## Setup für Coolify
|
||||
|
||||
@@ -38,8 +43,13 @@ Der Bot benötigt folgende Permissions:
|
||||
### 3. Coolify Deployment
|
||||
|
||||
1. **Repository**: Verbinde dein Git Repository mit Coolify
|
||||
2. **Umgebungsvariablen**: Setze folgende Variable in Coolify:
|
||||
2. **Umgebungsvariablen**: Setze folgende Variablen in Coolify:
|
||||
- `DISCORD_TOKEN` = Dein Bot Token
|
||||
- Entweder `DATABASE_URL` (mysql://user:pass@host:port/db) ODER Einzelwerte `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD`
|
||||
- Für YouTube (optional, empfohlen bei „Sign in to confirm you’re not a bot“):
|
||||
- `YTDL_COOKIES_B64` = Base64-kodierte cookies.txt (Netscape-Format), ODER
|
||||
- `YTDL_COOKIES_FILE` = Pfad zu cookies.txt im Container (z. B. /app/cookies.txt)
|
||||
- Optional: `YTDL_UA` (User-Agent), `YTDL_YT_CLIENT` (z. B. android/web)
|
||||
|
||||
3. **Build Settings**:
|
||||
- Coolify wird automatisch das Dockerfile verwenden
|
||||
@@ -76,6 +86,37 @@ Der Bot benötigt folgende Permissions:
|
||||
python app.py
|
||||
```
|
||||
|
||||
### YouTube-Cookies bereitstellen (empfohlen)
|
||||
|
||||
YouTube kann Server/Container ohne Cookies blockieren („Sign in to confirm you’re not a bot“). Übergib Cookies im Netscape-Format:
|
||||
|
||||
Variante A – Base64 via Env (einfach in Coolify)
|
||||
|
||||
1. Exportiere cookies.txt aus deinem Browser (Erweiterung „Get cookies.txt“ oder yt-dlp Export aus lokaler Browser-Session).
|
||||
2. Base64-kodiere die Datei (Windows PowerShell):
|
||||
|
||||
```powershell
|
||||
[Convert]::ToBase64String([IO.File]::ReadAllBytes("cookies.txt")) | Set-Clipboard
|
||||
```
|
||||
|
||||
3. In Coolify `YTDL_COOKIES_B64` setzen (Inhalt aus der Zwischenablage einfügen) und neu deployen.
|
||||
|
||||
Variante B – Datei mounten
|
||||
|
||||
- cookies.txt in den Container mounten (z. B. `/app/cookies.txt`) und `YTDL_COOKIES_FILE=/app/cookies.txt` setzen.
|
||||
|
||||
Optional: `YTDL_UA` setzen (aktueller Browser UA), `YTDL_YT_CLIENT` (z. B. `android`).
|
||||
|
||||
### Web testen (/webtest)
|
||||
|
||||
Mit `/webtest` prüft der Bot:
|
||||
|
||||
- HTTP-Reachability (Google 204, YouTube, Discord API)
|
||||
- yt-dlp-Extraction mit deiner Query oder einem Default-Suchbegriff
|
||||
- ob Cookies konfiguriert sind (Datei/B64/Browser)
|
||||
|
||||
So kannst du schnell sehen, ob der Container Internetzugriff hat und ob yt-dlp wegen Cookies scheitert.
|
||||
|
||||
## Docker
|
||||
|
||||
### Lokal mit Docker testen
|
||||
|
||||
Reference in New Issue
Block a user