Music lavalinkDuration

$lavalinkDuration[]

Returns the total duration of the currently playing track in milliseconds

Syntax
$lavalinkDuration[]

Return Value

integer

The duration of the currently playing track in milliseconds, or 0 if nothing is playing

Returns the total duration of the currently playing track in milliseconds. To display a human-readable format (minutes:seconds), divide by 60000 for minutes and use modulo for seconds. Returns 0 if no track is playing.

Examples

Show the track duration in milliseconds

$sendMessage[Duration: $lavalinkDuration[] ms]

Convert duration to minutes and seconds

$let[duration;$lavalinkDuration[]]
$let[minutes;$divide[$var[duration];60000]]
$let[seconds;$divide[$modulo[$var[duration];60000];1000]]
$sendMessage[Duration: $var[minutes]:$var[seconds]]

Show a progress bar

$let[pos;$lavalinkPosition[]]
$let[dur;$lavalinkDuration[]]
$sendMessage[$var[pos] / $var[dur] ms]