Added a direct youtube command and Readme file

This commit is contained in:
2026-03-12 02:40:58 +01:00
parent bee86fafe2
commit 0f2dde30a2
7 changed files with 213 additions and 44 deletions
+109
View File
@@ -1,2 +1,111 @@
# Radio-Bot
Discord-Radio- und YouTube-Bot mit Voice-Support für normale Voice-Channels.
## Voraussetzungen
- Windows
- Python 3.14.x
- FFmpeg im Projekt unter:
- `plugins/ffmpeg-8.0.1/bin/ffmpeg.exe`
- Discord Bot Token in:
- `bot_token.txt`
## Benötigte Python-Packages
- `discord.py==2.7.1`
- `davey==0.1.3`
- `PyNaCl==1.6.2`
- `yt-dlp`
- `pyinstaller`
## Virtuelle Umgebung anlegen
```powershell
py -3.14 -m venv .venv
.\.venv\Scripts\Activate
```
## Alle benötigten Packages installieren
```powershell
python -m pip install -U pip setuptools wheel
python -m pip install --only-binary=:all: "discord.py==2.7.1" "davey==0.1.3" "PyNaCl==1.6.2" "yt-dlp" "pyinstaller"
```
## Projekt starten
```powershell
python main.py
```
## EXE Build
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
```
## FFmpeg
FFmpeg wird im Projekt im Plugin-Ordner erwartet:
```text
plugins/ffmpeg-8.0.1/bin/ffmpeg.exe
```
Wenn eine andere FFmpeg-Version verwendet wird, muss der Pfad in `main.py` entsprechend angepasst werden.
## bot_token.txt
Die Datei `bot_token.txt` wird benötigt und muss sich befinden:
- beim normalen Python-Start im Projektordner
- beim EXE-Build im selben Ordner wie die `Radio-Bot.exe`
Beispiel:
```text
dist/Radio-Bot/bot_token.txt
```
Inhalt der Datei:
```text
DEIN_DISCORD_BOT_TOKEN
```
## Wichtige Ordnerstruktur
```text
Radio-Bot/
├─ main.py
├─ bot_token.txt
├─ plugins/
│ └─ ffmpeg-8.0.1/
│ └─ bin/
│ └─ ffmpeg.exe
└─ .venv/
```
## Verfügbare Commands
- `!call` – Bot in deinen Voice-Channel holen
- `!radio <url>` – Radio-Stream starten
- `!yt <url>` – YouTube-Link starten oder in Queue einreihen
- `!https://...` – YouTube-Link direkt ohne `!yt` einreihen
- `!play` – pausierte Wiedergabe fortsetzen oder nächsten YT-Track starten
- `!pause` – aktuelle Wiedergabe pausieren
- `!stop` – Wiedergabe stoppen und Queue löschen
- `!skip` – aktuellen YouTube-Track überspringen
- `!leave` – Bot aus dem Voice-Channel entfernen
- `!now` – aktuell laufenden Titel oder Stream anzeigen
- `!list` – aktuelle Wiedergabe und Queue anzeigen
- `!helpme` – Befehlsübersicht anzeigen
## Hinweise
- Der Bot nutzt pro Server genau eine Audio-Instanz.
- Für Voice-Funktionen müssen `PyNaCl` und `davey` korrekt installiert sein.
- Beim EXE-Build hilft `debu.log.txt` beim Debugging, falls sich die EXE direkt wieder schließt.