Music setMusicLoop

$setMusicLoop[]

Sets the looping mode for music playback

Syntax
$setMusicLoop[mode]

Parameters

Parameter Type Required Default Description
mode string check_circle Required The loop mode to set. Accepted values: off, track, queue
off track queue

Return Value

void

Sets the loop mode; does not return a value

Sets the looping behavior of the music player. Three modes are available: “off” disables looping entirely; “track” repeats only the currently playing track indefinitely; “queue” repeats the entire queue once all tracks finish. Use $lavalinkIsLooping to check if looping is currently active.

Examples

Enable track looping

$setMusicLoop[track]
$sendMessage[🔂 Looping the current track.]

Enable queue looping

$setMusicLoop[queue]
$sendMessage[🔁 Looping the entire queue.]

Disable looping

$setMusicLoop[off]
$sendMessage[➡️ Looping disabled.]

Cycle through loop modes

$if[$lavalinkIsLooping[==false]]
$setMusicLoop[track]
$sendMessage[🔂 Track loop enabled]
$else
$setMusicLoop[off]
$sendMessage[➡️ Looping disabled]
$endif