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 224dc788c8
commit 54753bb4fa

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_string = "a C2 Hercules full"
commodity = commodity.capitalize()
commodity = commodity.title()
embed = discord.Embed(
description="-------", color=discord.Color.blue(), type="rich"
)
try:
response = requests.get(url, headers=headers).json()["data"]
except Exception:
print(commodity)
embed.set_author(
name="❌ Couldnt find that commodity",
url="%s%s" % (wiki_url, commodity),
)
except Exception as e:
print(e)
embed.set_author(name="❌ Couldnt find that commodity")
embed.set_author(
name=commodity,
url="%s%s" % (wiki_url, commodity),
)
embed.set_author(name=commodity)
# Loop through every system/outpost and find the cheapest place selling the commodity
try: