Adding clickable links to the embed for ship price

This commit is contained in:
Luke Robles 2023-05-11 08:32:51 -07:00
parent bc92483f9c
commit f812319fcf

View File

@ -84,7 +84,23 @@ async def get_ship(ship_name):
.text
)
embed.add_field(name="**Pledge Price**", value=pledge_price, inline=True)
try:
links = soup.find_all("a", {"class": "external text"})
pledge_store_link = list(filter(lambda x: "Pledge" in x.text, links))[0][
"href"
]
embed.add_field(
name="**Pledge Price**",
value="[%s](%s)" % (pledge_price, pledge_store_link),
inline=True,
)
except Exception:
embed.add_field(
name="**Pledge Price**",
value=pledge_price,
inline=True,
)
# embed.add_field(name="-------", value="", inline=False)
# embed.add_field(name="**Description**", value=ship["description"], inline=False)