IDIOT MATH
This commit is contained in:
@@ -89,8 +89,10 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let companyFemales = 0;
|
let companyFemales = 0;
|
||||||
|
let companyTotal = 0;
|
||||||
const companyFemalePromises = Object.entries(company.employees).map(([user]) => {
|
const companyFemalePromises = Object.entries(company.employees).map(([user]) => {
|
||||||
return torn.cache.user(user).then(data => {
|
return torn.cache.user(user).then(data => {
|
||||||
|
companyTotal++;
|
||||||
if (data.gender === "Female") {
|
if (data.gender === "Female") {
|
||||||
companyFemales++;
|
companyFemales++;
|
||||||
}
|
}
|
||||||
@@ -98,9 +100,11 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let factionFemales = 0;
|
let factionFemales = 0;
|
||||||
|
let factionTotal = 0;
|
||||||
const factionMembers = await torn.faction.members(KZNKing.faction.faction_id);
|
const factionMembers = await torn.faction.members(KZNKing.faction.faction_id);
|
||||||
const factionFemalePromises = factionMembers.map((user) => {
|
const factionFemalePromises = factionMembers.map((user) => {
|
||||||
return torn.cache.user(user.id).then(data => {
|
return torn.cache.user(user.id).then(data => {
|
||||||
|
factionTotal++;
|
||||||
if (data.gender === "Female") {
|
if (data.gender === "Female") {
|
||||||
factionFemales++;
|
factionFemales++;
|
||||||
}
|
}
|
||||||
@@ -111,10 +115,10 @@ module.exports = {
|
|||||||
await Promise.all(companyFemalePromises);
|
await Promise.all(companyFemalePromises);
|
||||||
await Promise.all(factionFemalePromises);
|
await Promise.all(factionFemalePromises);
|
||||||
|
|
||||||
const companyFemalePercent = (companyFemales / company.employees_capacity) * 100;
|
const companyFemalePercent = (companyFemales / companyTotal) * 100;
|
||||||
const factionFemalePercent = (factionFemales / faction.capacity) * 100;
|
const factionFemalePercent = (factionFemales / factionTotal) * 100;
|
||||||
|
|
||||||
message += `\nbtw lol his company has ${companyFemales}/${company.employees_capacity} female employees and ${factionFemales}/${faction.capacity} female faction members\n`;
|
message += `\nbtw lol his company has ${companyFemales}/${companyTotal} female employees and ${factionFemales}/${factionTotal} female faction members\n`;
|
||||||
message += `thats ${companyFemalePercent.toFixed(0)}% and ${factionFemalePercent.toFixed(0)}% respectively, and last i checked, torn has a 13% female population`;
|
message += `thats ${companyFemalePercent.toFixed(0)}% and ${factionFemalePercent.toFixed(0)}% respectively, and last i checked, torn has a 13% female population`;
|
||||||
interaction.reply({ content: message, embeds: [jobEmbed, facEmbed] });
|
interaction.reply({ content: message, embeds: [jobEmbed, facEmbed] });
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user