From e4bdf94c5c148b8614dcb282f80c3aebacd21ed7 Mon Sep 17 00:00:00 2001 From: "Jill \"oatmealine\" Monoids" Date: Sun, 7 Nov 2021 15:28:20 +0300 Subject: [PATCH] queue fix --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4e40712..f0275ea 100644 --- a/src/index.js +++ b/src/index.js @@ -266,7 +266,7 @@ bot.on('messageCreate', async (msg) => { if (q.length === 0) { msg.channel.send('no songs queued!'); } else { - msg.channel.send(`${q.length} tracks\ntotal queue length: ${formatTime(q.reduce((p, c) => (p || {duration: 0}).duration || 0 + c.duration || 0))}\n` + '```' + q.slice(0, 10).map((m, i) => `${i === 0 ? 'now playing:' : i + '.'} ${m.title} ${(m.duration !== 0) ? formatTime(m.duration) : ''}`).join('\n') + '```'); + msg.channel.send(`${q.length} tracks\ntotal queue length: ${formatTime(q.reduce((p, c) => p || 0 + c.duration || 0))}\n` + '```' + q.slice(0, 10).map((m, i) => `${i === 0 ? 'now playing:' : i + '.'} ${m.title} ${(m.duration !== 0) ? formatTime(m.duration) : ''}`).join('\n') + '```'); } } else if (cmd === 'np' || cmd === 'nowplaying') { const song = (queue[msg.guild.id] || [])[0];