From edd3f3519279963426486b4089d3c431aee074fc Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 23 Oct 2017 02:47:42 +0000 Subject: [PATCH] Fix --- commands/games/wizard-convention.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/commands/games/wizard-convention.js b/commands/games/wizard-convention.js index d6fcebba..2ab977b0 100644 --- a/commands/games/wizard-convention.js +++ b/commands/games/wizard-convention.js @@ -125,11 +125,15 @@ module.exports = class WizardConventionCommand extends Command { const counts = new Collection(); for (const vote of votes.values()) { const player = players.get(parseInt(vote.content, 10)); - counts.set(player.id, { - id: player.id, - votes: counts.has(player.id) ? ++counts.get(player.id).votes : 1, - user: player.user - }); + if (counts.has(player.id)) { + ++counts.get(player.id).votes; + } else { + counts.set(player.id, { + id: player.id, + votes: 1, + user: player.user + }); + } } if (!counts.size) { await msg.say('No one will be expelled.');