From ff55f43fff323720c7cca29247e86fe418324d8a Mon Sep 17 00:00:00 2001 From: Baltraz Date: Thu, 5 Sep 2024 19:59:06 +0200 Subject: [PATCH] Update mayorCommand.js --- src/minecraft/commands/mayorCommand.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/minecraft/commands/mayorCommand.js b/src/minecraft/commands/mayorCommand.js index 8248d8e0..046e8cf8 100644 --- a/src/minecraft/commands/mayorCommand.js +++ b/src/minecraft/commands/mayorCommand.js @@ -25,13 +25,13 @@ class MayorCommand extends minecraftCommand { this.send( `/gc [MAYOR] ${data.mayor.name} is the current mayor of Skyblock! Perks: ${data.mayor.perks .map((perk) => perk.name) - .join(", ")}, ${data.mayor.minister.perk[0].name}`, + .join(", ")}, Minister Perk: ${data.mayor.minister.perk.name}`, ); await delay(500); - if (data.current.candidates.length > 0) { - const currentLeader = data.current.candidates.sort((a, b) => (b.votes || 0) - (a.votes || 0))[0]; + if (data.mayor.election.candidates.length > 0) { + const currentLeader = data.mayor.election.candidates.sort((a, b) => (b.votes || 0) - (a.votes || 0))[0]; if (!currentLeader) return; - const totalVotes = data.current.candidates.reduce((total, candidate) => total + (candidate.votes || 0), 0); + const totalVotes = data.mayor.election.candidates.reduce((total, candidate) => total + (candidate.votes || 0), 0); const percentage = ((currentLeader.votes || 0) / totalVotes) * 100; this.send(`/gc [MAYOR] Current Election: ${currentLeader.name} has ${percentage.toFixed(2)}% of the votes.`); }