Add max value and also fix some var names

This commit is contained in:
Luke Robles 2023-06-13 10:38:48 -07:00
parent 0f727ed69e
commit 27caa77a65
2 changed files with 8 additions and 4 deletions

View File

@ -52,8 +52,12 @@ class StarCitizen(commands.Cog):
name="scu",
description="Optinal how much SCU to fill",
required=False,
min_value=1,
max_value=98304,
)
async def calculate_trade_profies(self, ctx: commands.Context, commodity, scu):
async def calculate_trade_profies(
self, ctx: commands.Context, commodity: str, scu: int
):
await ctx.defer()
embed = await star_citizen.calculate_trade_profies(commodity=commodity, scu=scu)
await ctx.send_followup(embed=embed)

View File

@ -241,8 +241,8 @@ async def calculate_trade_profies(commodity, scu=None):
for systems, stations in response.items():
for station, trades in stations.items():
if "sell" in trades and commodity in trades["sell"]:
net_profit_in_a_c2 = trades["sell"][commodity] * int(scu)
profits[station] = net_profit_in_a_c2
net_profit = trades["sell"][commodity] * int(scu)
profits[station] = net_profit
embed.add_field(
name="Most profitable place to sell %s" % scu_string,
@ -265,7 +265,7 @@ async def calculate_trade_profies(commodity, scu=None):
)
return embed
except ValueError:
except Exception:
print(commodity)
embed.set_author(
name="❌ Couldnt find that commodity",