Fixing how we're searching for commodities on the api by using string.title()

This commit is contained in:
Luke Robles 2023-06-15 22:54:30 -07:00
parent 02ab4318fb
commit f6dcd35ae0

16
app/star_citizen.py Normal file → Executable file
View File

@ -213,24 +213,18 @@ async def calculate_trade_profies(commodity, scu=None):
scu = 696 scu = 696
scu_string = "a C2 Hercules full" scu_string = "a C2 Hercules full"
commodity = commodity.capitalize() commodity = commodity.title()
embed = discord.Embed( embed = discord.Embed(
description="-------", color=discord.Color.blue(), type="rich" description="-------", color=discord.Color.blue(), type="rich"
) )
try: try:
response = requests.get(url, headers=headers).json()["data"] response = requests.get(url, headers=headers).json()["data"]
except Exception: except Exception as e:
print(commodity) print(e)
embed.set_author( embed.set_author(name="❌ Couldnt find that commodity")
name="❌ Couldnt find that commodity",
url="%s%s" % (wiki_url, commodity),
)
embed.set_author( embed.set_author(name=commodity)
name=commodity,
url="%s%s" % (wiki_url, commodity),
)
# Loop through every system/outpost and find the cheapest place selling the commodity # Loop through every system/outpost and find the cheapest place selling the commodity
try: try: