fix total wealth calc in profile command
@@ -112,7 +112,7 @@ class Econ(commands.Cog):
total_wealth = (
db_user["emeralds"]
+ db_user.get("vault_bal", 0) * 9
- + sum([u_it.get("sell_price", 0) * u_it.get("amount", 0) for u_it in u_items])
+ + sum([u_it.["sell_price"] * u_it.get("amount", 0) for u_it in u_items if u_it["sell_price"] > 0])
)
health_bar = make_health_bar(
db_user["health"], 20, self.d.emojis.heart_full, self.d.emojis.heart_half, self.d.emojis.heart_empty
@@ -165,8 +165,11 @@ class Econ(commands.Cog):
vault_bal = db_user["vault_bal"]
- total_wealth = db_user["emeralds"] + ((0 if vault_bal is None else vault_bal) * 9)
- total_wealth += sum([u_it["sell_price"] * u_it["amount"] for u_it in u_items if u_it["sell_price"] > 0])
+ total_wealth = (
+ db_user["emeralds"]
+ + ((0 if vault_bal is None else vault_bal) * 9)
+ + sum([u_it["sell_price"] * u_it["amount"] for u_it in u_items if u_it["sell_price"] > 0])
+ )
embed = discord.Embed(color=self.d.cc)
embed.set_author(name=ctx.l.econ.bal.s_emeralds.format(user.display_name), icon_url=user.avatar_url_as())
