kzn command only embed what he owns

This commit is contained in:
2026-01-10 10:06:32 -05:00
parent 72aabc83bd
commit 3753573574

View File

@@ -11,10 +11,12 @@ module.exports = {
let message = `${KZNKing.name} has ${KZNKing.friends} friends and ${KZNKing.enemies} enemies. `; let message = `${KZNKing.name} has ${KZNKing.friends} friends and ${KZNKing.enemies} enemies. `;
(KZNKing.married.duration) ? message += `He has been married to [${KZNKing.married.spouse_name}](https://www.torn.com/profiles.php?XID=${KZNKing.married.spouse_id}) for ${KZNKing.married.duration} days. ` : message += `He is not married. `; (KZNKing.married.duration) ? message += `He has been married to [${KZNKing.married.spouse_name}](https://www.torn.com/profiles.php?XID=${KZNKing.married.spouse_id}) for ${KZNKing.married.duration} days. ` : message += `He is not married. `;
(KZNKing.property === "Private Island") ? message += `He has a Private Island. ` : message += `He does not have a Private Island. `; (KZNKing.property === "Private Island") ? message += `He has a Private Island. ` : message += `He does not have a Private Island. `;
(KZNKing.job.position === "Director") ? message += `He is director of ${KZNKing.job.company_name}. ` : message += `He is not director of a company. `; (KZNKing.job.position === "Director") ? message += `He is director of ${KZNKing.job.company_name}. ` : message += `He is not director of his company. `;
(KZNKing.faction.position === "Leader") ? message += `He is leader of ${KZNKing.faction.faction_name}. ` : message += `He is not leader of his faction. `; (KZNKing.faction.position === "Leader") ? message += `He is leader of ${KZNKing.faction.faction_name}. ` : message += `He is not leader of his faction. `;
const company = (await torn.company(KZNKing.job.company_id)); const company = (await torn.company(KZNKing.job.company_id));
const embeds = [];
if (KZNKing.job.position === "Director") {
const jobEmbed = new EmbedBuilder() const jobEmbed = new EmbedBuilder()
.setTitle(company.name) .setTitle(company.name)
.setURL(`https://www.torn.com/joblist.php#/p=corpinfo&ID=${company.ID}`) .setURL(`https://www.torn.com/joblist.php#/p=corpinfo&ID=${company.ID}`)
@@ -54,9 +56,12 @@ module.exports = {
value: String(company.rating), value: String(company.rating),
inline: true inline: true
} }
) );
embeds.push(jobEmbed);
}
const faction = await torn.faction.basic(KZNKing.faction.faction_id) const faction = await torn.faction.basic(KZNKing.faction.faction_id)
if (KZNKing.faction.position === "Leader") {
const facEmbed = new EmbedBuilder() const facEmbed = new EmbedBuilder()
.setTitle(faction.name) .setTitle(faction.name)
.setURL(`https://www.torn.com/factions.php?step=profile&ID=${faction.id}`) .setURL(`https://www.torn.com/factions.php?step=profile&ID=${faction.id}`)
@@ -87,6 +92,8 @@ module.exports = {
inline: true inline: true
}, },
); );
embeds.push(facEmbed);
}
let companyFemales = 0; let companyFemales = 0;
let companyTotal = 0; let companyTotal = 0;
@@ -120,6 +127,6 @@ module.exports = {
message += `\nbtw lol his company has ${companyFemales}/${companyTotal} female employees and ${factionFemales}/${factionTotal} 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: embeds });
}, },
}; };