Add max value and also fix some var names
This commit is contained in:
parent
0f727ed69e
commit
27caa77a65
@ -52,8 +52,12 @@ class StarCitizen(commands.Cog):
|
|||||||
name="scu",
|
name="scu",
|
||||||
description="Optinal how much SCU to fill",
|
description="Optinal how much SCU to fill",
|
||||||
required=False,
|
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()
|
await ctx.defer()
|
||||||
embed = await star_citizen.calculate_trade_profies(commodity=commodity, scu=scu)
|
embed = await star_citizen.calculate_trade_profies(commodity=commodity, scu=scu)
|
||||||
await ctx.send_followup(embed=embed)
|
await ctx.send_followup(embed=embed)
|
||||||
|
@ -241,8 +241,8 @@ async def calculate_trade_profies(commodity, scu=None):
|
|||||||
for systems, stations in response.items():
|
for systems, stations in response.items():
|
||||||
for station, trades in stations.items():
|
for station, trades in stations.items():
|
||||||
if "sell" in trades and commodity in trades["sell"]:
|
if "sell" in trades and commodity in trades["sell"]:
|
||||||
net_profit_in_a_c2 = trades["sell"][commodity] * int(scu)
|
net_profit = trades["sell"][commodity] * int(scu)
|
||||||
profits[station] = net_profit_in_a_c2
|
profits[station] = net_profit
|
||||||
|
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="Most profitable place to sell %s" % scu_string,
|
name="Most profitable place to sell %s" % scu_string,
|
||||||
@ -265,7 +265,7 @@ async def calculate_trade_profies(commodity, scu=None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
return embed
|
return embed
|
||||||
except ValueError:
|
except Exception:
|
||||||
print(commodity)
|
print(commodity)
|
||||||
embed.set_author(
|
embed.set_author(
|
||||||
name="❌ Couldnt find that commodity",
|
name="❌ Couldnt find that commodity",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user