From 47fd83b35b1ffb27ca51e45f6219c5436cce80d2 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Fri, 13 Oct 2023 10:18:44 -0700 Subject: [PATCH] Cleaning up some stuff and also adding the items uuid as a variable when using /ship, not sure what to do with it yet --- app/cogs/star_citizen.py | 2 +- app/star_citizen.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/cogs/star_citizen.py b/app/cogs/star_citizen.py index f8811d94..1352b942 100644 --- a/app/cogs/star_citizen.py +++ b/app/cogs/star_citizen.py @@ -235,7 +235,7 @@ class StarCitizen(commands.Cog): latest_incident.find_next("div", class_="issue no-underline") .get("onclick") .split("=")[-1] - .replace("\\", "") + .replace("\\", "").replace("'", "") ) details = latest_incident.findNext("span", {"class": "issue__content"}).text diff --git a/app/star_citizen.py b/app/star_citizen.py index ac8ca043..96c81184 100755 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -230,6 +230,15 @@ async def get_ship(ship_name): embed.set_image(url=ship_image) + try: + item_uuid = ( + soup.find("div", {"class": "infobox__label"}, string="UUID") + .findNext("div", {"class": "infobox__data"}) + .text + ) + except Exception: + item_uuid = "N/A" + except Exception as e: print(e) embed = discord.Embed(description="❌", color=discord.Color.red(), type="rich")