> ## Documentation Index
> Fetch the complete documentation index at: https://docs.katofficial.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Music

> Audio playback in voice channels via Lavalink

The Music cog provides audio playback in voice channels via a Lavalink backend (using the `mafic` library). It is only loaded when `LAVALINK_HOST`, `LAVALINK_PORT`, and `LAVALINK_PASSWORD` are configured in the environment.

## Commands

All commands are nested under `/music`.

| Command             | Description                                                                                                     |
| ------------------- | --------------------------------------------------------------------------------------------------------------- |
| `/music join`       | Connects the bot to the caller's current voice channel.                                                         |
| `/music play`       | Searches for a track or plays a direct URL. Supports YouTube, SoundCloud, and other Lavalink-supported sources. |
| `/music pause`      | Pauses playback.                                                                                                |
| `/music resume`     | Resumes paused playback.                                                                                        |
| `/music skip`       | Skips the current track.                                                                                        |
| `/music stop`       | Stops playback and clears the queue.                                                                            |
| `/music disconnect` | Clears player state and moves the bot to its home voice channel (if configured).                                |
| `/music queue`      | Shows all upcoming tracks in the queue with pagination.                                                         |
| `/music nowplaying` | Replaces or posts the now-playing panel embed showing the current track.                                        |
| `/music autoplay`   | Toggles autoplay of related tracks when the queue is empty.                                                     |
| `/music shuffle`    | Shuffles the current queue.                                                                                     |
| `/music lyrics`     | Fetches lyrics for the currently playing track.                                                                 |
| `/music volume`     | Sets playback volume (1–100).                                                                                   |
| `/music seek`       | Seeks to a specific position in the current track (e.g. `1m30s`).                                               |
| `/music loop_track` | Toggles looping of the current track.                                                                           |
| `/music loop_queue` | Toggles looping of the entire queue.                                                                            |

## Permission Requirements

Playback control commands require the caller to be in the same voice channel as the bot (or in a voice channel if the bot is idle). Volume and skip commands may have additional restrictions depending on configuration.
