mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -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}
|
||||
`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user