dont capitalize the ship name

This commit is contained in:
Luke Robles 2023-05-01 20:44:12 -07:00
parent f36d437066
commit c679d87f25

View File

@ -8,7 +8,7 @@ async def get_ship(ship_name):
wiki_url = "https://starcitizen.tools/" wiki_url = "https://starcitizen.tools/"
try: try:
wiki_ship_name = "_".join(elem.capitalize() for elem in ship_name.split()) wiki_ship_name = "_".join(elem for elem in ship_name.split())
# print(wiki_ship_name) # print(wiki_ship_name)
# print("%s%s" % (wiki_url, wiki_ship_name)) # print("%s%s" % (wiki_url, wiki_ship_name))
@ -59,7 +59,7 @@ async def get_ship(ship_name):
.text .text
) )
# Hideous code for "where to buy" in game ## Hideous code for "where to buy" in game
# table = soup.find("span", {"id": "Buying"}).findNext( # table = soup.find("span", {"id": "Buying"}).findNext(
# "table", {"class": "wikitable"} # "table", {"class": "wikitable"}
# ) # )
@ -134,8 +134,8 @@ async def get_ship(ship_name):
embed.add_field( embed.add_field(
name="**Expedite claim time**", value=expedited_claim_time, inline=True name="**Expedite claim time**", value=expedited_claim_time, inline=True
) )
except Exception: except Exception as e:
pass print(e)
try: try:
expedited_fee = ( expedited_fee = (
@ -146,7 +146,8 @@ async def get_ship(ship_name):
.text .text
) )
embed.add_field(name="**Expedite Fee**", value=expedited_fee, inline=True) embed.add_field(name="**Expedite Fee**", value=expedited_fee, inline=True)
except Exception: except Exception as e:
print(e)
pass pass
embed.add_field( embed.add_field(
@ -163,6 +164,7 @@ async def get_ship(ship_name):
% ship_name, % ship_name,
inline=True, inline=True,
) )
print(e)
return embed return embed
return embed return embed