Show full results in sorting hat

This commit is contained in:
Daniel Odendahl Jr
2019-03-11 17:07:10 +00:00
parent 01364343f5
commit 0ef777da4e
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -59,11 +59,14 @@ module.exports = class SortingHatCommand extends Command {
for (const [house, amount] of Object.entries(answer.points)) points[house] += amount;
++turn;
}
const house = Object.keys(points).sort((a, b) => points[b] - points[a])[0];
const houseResult = Object.keys(points).sort((a, b) => points[b] - points[a]);
this.playing.delete(msg.channel.id);
const totalPoints = points.g + points.s + points.h + points.r;
return msg.say(stripIndents`
You are a member of... **${houses[house]}**!
_${descriptions[house]}_
You are a member of... **${houses[houseResult[0]]}**!
_${descriptions[houseResult[0]]}_
${houseResult.map(house => `${houses[house]}: ${Math.round(points[house] / totalPoints)}%`).join('\n')}
`);
} catch (err) {
this.playing.delete(msg.channel.id);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "101.10.1",
"version": "101.10.2",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {