added avatar image system

This commit is contained in:
2026-04-10 17:51:00 +02:00
parent 6d59858b87
commit 9ace3454e0
7 changed files with 263 additions and 5 deletions
+33 -1
View File
@@ -10,6 +10,8 @@ Discord-Radio- und YouTube-Bot mit Voice-Support für normale Voice-Channels.
- `plugins/ffmpeg-8.0.1/bin/ffmpeg.exe`
- Discord Bot Token in:
- `bot_token.txt`
- Bot-Avatare im Laufzeitordner:
- `avatars/`
## Benötigte Python-Packages
@@ -44,7 +46,7 @@ python main.py
Build immer aus dem aktivierten `.venv` ausführen.
```powershell
python -m PyInstaller --noconfirm --clean --onedir --name Radio-Bot --hidden-import discord --hidden-import discord.ext.commands --hidden-import yt_dlp --collect-all discord --collect-all yt_dlp --collect-all nacl --collect-all davey --copy-metadata discord.py --copy-metadata yt-dlp --copy-metadata PyNaCl --copy-metadata davey --add-binary "D:\Git\Radio-Bot\plugins\ffmpeg-8.0.1\bin\ffmpeg.exe;plugins\ffmpeg-8.0.1\bin" main.py
python -m PyInstaller --noconfirm --clean --onedir --name Radio-Bot --hidden-import discord --hidden-import discord.ext.commands --hidden-import yt_dlp --collect-all discord --collect-all yt_dlp --collect-all nacl --collect-all davey --copy-metadata discord.py --copy-metadata yt-dlp --copy-metadata PyNaCl --copy-metadata davey --add-binary "D:\Git\Radio-Bot\plugins\ffmpeg-8.0.1\bin\ffmpeg.exe;plugins\ffmpeg-8.0.1\bin" --add-data "D:\Git\Radio-Bot\avatars;avatars" main.py
```
## FFmpeg
@@ -76,12 +78,42 @@ Inhalt der Datei:
DEIN_DISCORD_BOT_TOKEN
```
## Dynamische Bot-Avatare
Der Bot kann sein Avatarbild abhängig vom aktuellen Status automatisch wechseln.
Status-Dateien im Ordner `avatars/`:
- `idle.png`
- `radio.png`
- `youtube.png` oder `yt.png`
- `leaving.png`
- optional `default.png` oder `fallback.png`
Unterstützte Formate: `.png`, `.jpg`, `.jpeg`, `.webp`, `.gif`
Wichtig:
- Die Dateien werden direkt aus dem Laufzeitordner geladen.
- Beim normalen Python-Start ist das der Projektordner.
- Beim EXE-Build ist das der Ordner neben der `Radio-Bot.exe`.
- Du kannst die Bilder später austauschen, ohne den Bot neu zu bauen.
- Das neue Bild wird beim nächsten passenden Statuswechsel automatisch geladen.
- Wenn ein Statusbild fehlt, versucht der Bot automatisch `idle` und danach `default` bzw. `fallback`.
- Beim Start schreibt der Bot ins Log, welche Avatar-Dateien erkannt wurden.
## Wichtige Ordnerstruktur
```text
Radio-Bot/
├─ main.py
├─ bot_token.txt
├─ avatars/
│ ├─ idle.png
│ ├─ radio.png
│ ├─ youtube.png
│ └─ leaving.png
│ └─ default.png
├─ plugins/
│ └─ ffmpeg-8.0.1/
│ └─ bin/