From 94298202b84062d690144170098cf2684ae65511 Mon Sep 17 00:00:00 2001 From: smsteel Date: Mon, 11 Feb 2019 16:09:01 +0300 Subject: [PATCH] kill count --- bot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] = {