From f6dcd35ae095990815bdaab4a2fc2751e455790c Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Thu, 15 Jun 2023 22:54:30 -0700 Subject: [PATCH] Fixing how we're searching for commodities on the api by using string.title() --- app/star_citizen.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) mode change 100644 => 100755 app/star_citizen.py diff --git a/app/star_citizen.py b/app/star_citizen.py old mode 100644 new mode 100755 index cdd24bb0..20cc099d --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -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: