Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MrlolDev committed Dec 17, 2023
1 parent de5f865 commit 8e31b13
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bot/utils/premium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function generatePremiumEmbed(premiumInfo: {
if (expensesFields.length >= 10) break;
expensesFields.push({
name: `${expense.type.slice(0, 1).toUpperCase()}${expense.type.slice(1)} - using \`${expense.data.model
}\` - $${expense.used.toFixed(5)}`,
}\` - $${expense.used?.toFixed(5) ?? "0"}`,
value: `<t:${Math.floor(expense.time / 1000)}:R>`,
});
}
Expand All @@ -80,7 +80,7 @@ export async function generatePremiumEmbed(premiumInfo: {
if (expensesFields.length >= 10) break;
expensesFields.push({
name: `${expense.type.slice(0, 1).toUpperCase()}${expense.type.slice(1)} - using \`${expense.data.model
}\` - $${expense.used.toFixed(5)}`,
}\` - $${expense.used?.toFixed(5) ?? "0"}`,
value: `<t:${Math.floor(expense.time / 1000)}>`,
});
}
Expand All @@ -99,7 +99,7 @@ export async function generatePremiumEmbed(premiumInfo: {
chargesFields.push({
name: `${charge.type.slice(0, 1).toUpperCase()}${charge.type.slice(1)} ${charge.gateway ? `- using \`${charge.gateway}\`` : ""
}`,
value: `$${charge.amount.toFixed(2)} - <t:${Math.floor(charge.time / 1000)}>`,
value: `$${charge.amount?.toFixed(2) ?? "0"} - <t:${Math.floor(charge.time / 1000)}>`,
});
}
} else if (premiumInfo.premiumSelection.location === "guild" && guild?.plan) {
Expand All @@ -108,7 +108,7 @@ export async function generatePremiumEmbed(premiumInfo: {
chargesFields.push({
name: `${charge.type.slice(0, 1).toUpperCase()}${charge.type.slice(1)} ${charge.gateway ? `- using \`${charge.gateway}\`` : ""
}`,
value: `$${charge.amount.toFixed(2)} - <t:${Math.floor(charge.time / 1000)}>`,
value: `$${charge.amount?.toFixed(2)} - <t:${Math.floor(charge.time / 1000)}>`,
});
}
}
Expand All @@ -123,10 +123,10 @@ export async function generatePremiumEmbed(premiumInfo: {
// LAST EMBED
let description = "";
if (premiumInfo.premiumSelection.location === "user" && user.plan) {
description = `**$${user.plan?.used.toFixed(2)}**\`${generateProgressBar(user.plan.total, user.plan.used)}\`**$${user.plan?.total
description = `**$${user.plan?.used?.toFixed(2)}**\`${generateProgressBar(user.plan.total, user.plan.used)}\`**$${user.plan?.total
}**`;
} else if (premiumInfo.premiumSelection.location === "guild" && guild?.plan) {
description = `**$${guild.plan?.used.toFixed(2)}**\`${generateProgressBar(guild.plan.total, guild.plan.used)}\`**$${guild.plan?.total
description = `**$${guild.plan?.used?.toFixed(2)}**\`${generateProgressBar(guild.plan.total, guild.plan.used)}\`**$${guild.plan?.total
}**`;
}
embeds.push({
Expand Down

0 comments on commit 8e31b13

Please sign in to comment.