If there is no ingame price, do not make the link clickable

This commit is contained in:
Luke Robles 2023-05-25 09:37:05 -07:00
parent 0d5981eef9
commit 3eabe5cf80

View File

@ -59,6 +59,11 @@ async def get_ship(ship_name):
.text .text
) )
price = "[%s](%s%s#Buying)" % (ingame_price, wiki_url, wiki_ship_name)
if "Not available" in ingame_price:
price = "N/A"
## 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"}
@ -76,9 +81,10 @@ async def get_ship(ship_name):
# if not len(ingame_price): # if not len(ingame_price):
# ingame_price = "No in-game price available" # ingame_price = "No in-game price available"
embed.add_field( embed.add_field(
name="**Ingame Price**", name="**Ingame Price**",
value="[%s](%s%s#Buying)" % (ingame_price, wiki_url, wiki_ship_name), value=price,
inline=True, inline=True,
) )