Files
2026-11-16 21:37:42 +01:00

18 lines
948 B
Markdown

# DiscordBot
## Overview
Single-file Discord music bot (`bot.py`) using discord.py slash commands, yt-dlp for YouTube extraction and ffmpeg for streaming.
## Commands
- Dev: `python bot.py` (needs `.env` with `DISCORD_TOKEN`)
- Install: `pip install -r requirements.txt` (inside `.venv`)
- Lint/test: none configured yet
## Architecture
Per-guild `GuildPlayer` (queue + current track) held by `MusicBot`. `/play` resolves title/URL in a thread and queues it; `play_next` pipes `yt-dlp -o -` into ffmpeg (googlevideo returns 403 to ffmpeg's own HTTP client) and chains playback via the `after` callback.
## Gotchas
- yt-dlp breaks often when YouTube changes; fix with `pip install -U yt-dlp`.
- Set `DISCORD_GUILD_ID` for instant slash-command sync during development.
- `davey` is pinned `<0.2`: with 0.2.0 the bot joins voice and "plays" but nobody hears it (DAVE session never ready). Check `vc._connection.can_encrypt` when audio is silent.