Music
playMusic
$playMusic[]
Plays a track from a search query or URL, auto-joining a voice channel if needed
Syntax
$playMusic[query;channelID?;userId?]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| query | string | check_circle Required | — | The search query or direct URL to play (YouTube, SoundCloud, etc.) |
| channelID | snowflake | Optional |
user's current voice channel
|
The voice channel ID to play in. If omitted, auto-joins the user's voice channel |
| userId | snowflake | Optional |
current user
|
The user ID whose voice channel to join when no channelID is specified |
Return Value
void
Queues the track for playback; does not return a value
Searches for a track by query or plays directly from a supported URL (YouTube, SoundCloud, etc.). If the bot is not already in a voice channel, it automatically joins the user’s voice channel (or the specified channel). If a track is already playing, the new track is added to the queue.
Examples
Play a song by search query
$playMusic[Never Gonna Give You Up]
$sendMessage[🎵 Added to queue!]
Play from a direct URL
$playMusic[https://www.youtube.com/watch?v=dQw4w9WgXcQ]
$sendMessage[🎵 Queued from URL!]
Play in a specific voice channel
$playMusic[chill lofi beats;$voiceChannelID]
$sendMessage[🎵 Playing in <#$voiceChannelID>]
Play for a specific user's channel
$playMusic[lofi hip hop;;$authorID]
$sendMessage[🎵 Joining your channel, <@$authorID>!]