diff --git a/src/index.js b/src/index.js index eaf6782..9a3af75 100644 --- a/src/index.js +++ b/src/index.js @@ -253,7 +253,7 @@ bot.on('messageCreate', async (msg) => { if (!msg.guild || !content.startsWith(prefix) || !msg.channel) return; if ((cmd === 'playm' || cmd === 'playmany' || cmd === 'pm') && params[1]) { - for (const p of params.slice(1)) { + for (const p of params.slice(1)) { await playOrQueue(p, msg.channel, msg); } } else if (cmd === 'play' || cmd === 'p') { @@ -274,7 +274,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 || 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} track${q.length === 1 ? '' : 's'}\ntotal queue length: \`${formatTime(q.map(s => s.duration).reduce((p, c) => p || 0 + c || 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];