From f6d50732bcfd8a53d5dfd93180d31daf0eb8eb21 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Thu, 25 May 2023 09:37:05 -0700 Subject: [PATCH] If there is no ingame price, do not make the link clickable --- app/star_citizen.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/star_citizen.py b/app/star_citizen.py index 91f21dfc..1250e9fd 100644 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -59,6 +59,11 @@ async def get_ship(ship_name): .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 # table = soup.find("span", {"id": "Buying"}).findNext( # "table", {"class": "wikitable"} @@ -76,9 +81,10 @@ async def get_ship(ship_name): # if not len(ingame_price): # ingame_price = "No in-game price available" + embed.add_field( name="**Ingame Price**", - value="[%s](%s%s#Buying)" % (ingame_price, wiki_url, wiki_ship_name), + value=price, inline=True, )