This commit is contained in:
lilyissillyyy
2025-09-18 17:30:02 -04:00
parent 3038d8108f
commit 15b374b44c
+2 -1
View File
@@ -74,11 +74,12 @@ module.exports = class SortingHatCommand extends Command {
}
const houseResult = Object.keys(points).filter(h => points[h] > 0).sort((a, b) => points[b] - points[a]);
const totalPoints = houseResult.reduce((a, b) => a + points[b], 0);
const lb = houseResult.map(house => `${houses[house]}: ${Math.round((points[house] / totalPoints) * 100)}%`).join('\n');
return msg.say(stripIndents`
You are a member of... **${houses[houseResult[0]]}**!
_${descriptions[houseResult[0]]}_
${houseResult.map(house => `${houses[house]}: ${Math.round((points[house] / totalPoints) * 100)}%`).join('\n')}
${houseResult[0] === 'b' ? '' : lb}
`);
}
};