diff --git a/app/cogs/star_citizen.py b/app/cogs/star_citizen.py index b23b7bf8..5b5c7706 100644 --- a/app/cogs/star_citizen.py +++ b/app/cogs/star_citizen.py @@ -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) diff --git a/app/star_citizen.py b/app/star_citizen.py index 7afc67e3..c483a64a 100644 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -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",