From 389718279735647217cc3100ffdb3b6b2f14e08b Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 4 May 2022 15:37:59 -0600 Subject: [PATCH] music.queue: add total length --- src/modules/music.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/music.js b/src/modules/music.js index 347a3ee..5222367 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -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)}`, }, }, };