diff --git a/bot.js b/bot.js index 0b47a1a..e7a9540 100644 --- a/bot.js +++ b/bot.js @@ -36,10 +36,10 @@ bot.command( 'kills', ({ replyWithMarkdown }) => getAllKills() .then(allKills => { - let groupedKills = [] + let groupedKills = [{}] let currentGroupId = 0 allKills.forEach(kills => { - if (currentGroupId !== 0 && groupedKills[currentGroupId].displayName !== kills.displayName) { + if (groupedKills[currentGroupId].displayName && groupedKills[currentGroupId].displayName !== kills.displayName) { currentGroupId++ } groupedKills[currentGroupId] = {