<div align="center">

# D4PID

**A lightweight Discord music bot that streams audio from YouTube into voice channels.**

![Python](https://img.shields.io/badge/Python-3.10+-3776AB?style=flat-square&logo=python&logoColor=white)
![Discord](https://img.shields.io/badge/Discord-Bot-5865F2?style=flat-square&logo=discord&logoColor=white)
![FFmpeg](https://img.shields.io/badge/FFmpeg-required-007808?style=flat-square&logo=ffmpeg&logoColor=white)

</div>

---

## Commands

| Command         | Description                                            |
| --------------- | ------------------------------------------------------ |
| `/play <query>` | Search YouTube and play a song, or add it to the queue |
| `/skip`         | Skip the currently playing song                        |
| `/pause`        | Pause playback                                         |
| `/resume`       | Resume playback                                        |
| `/stop`         | Stop playback, clear the queue, and disconnect         |

---

## Setup

### Prerequisites

- Python **3.10+**
- [FFmpeg](https://ffmpeg.org/download.html) — place `ffmpeg.exe` in `bin/ffmpeg/`, or add it to your system PATH

---

### 1. Clone the repository

```bash
git clone https://github.com/aluukill/D4PID.git
cd D4PID
```

### 2. Install dependencies

```bash
pip install -r requirements.txt
```

### 3. Create a Discord bot

1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) and click **New Application**
2. Name it anything, then go to the **Bot** tab in the left sidebar
3. Click **Reset Token**, then **Copy** the token

> **Keep your token private.** Anyone with it has full control of your bot.

4. Under **OAuth2 → URL Generator**:
   - In **Scopes**, check `bot` and `applications.commands`
   - In **Bot Permissions**, check `Administrator`
5. Copy the generated URL, open it in your browser, and add the bot to your server

> **Note:** D4PID uses slash commands only, so no Privileged Gateway Intents need to be enabled.

---

### 4. Configure environment

Create a `.env` file in the root directory and paste your token:

```env
DISCORD_TOKEN=paste_your_token_here
```

---

### 5. Run the bot

```bash
py bot.py
```

---

## Notes

- The bot stays connected between songs — new tracks can be queued without it leaving the channel
- Audio streams at **96kbps Opus** for low-latency playback
