music.queue: add total length

This commit is contained in:
Cynthia Foxwell 2022-05-04 15:37:59 -06:00
parent 10f1a178bc
commit 3897182797

View file

@ -652,13 +652,20 @@ command.callback = async function (msg, line) {
nextTrack += item.length;
}
let totalLength = 0;
for (const item of queue) {
totalLength += item.length;
}
return {
embed: {
title: ":inbox_tray: Currently Queued",
color: 0x0088cc,
fields,
footer: {
text: queue.length > 9 ? `Showing 9/${queue.length} items` : "",
text:
(queue.length > 9 ? `Showing 9/${queue.length} items | ` : "") +
`Total length: ${formatTime(totalLength)}`,
},
},
};