Fixing the /ship command to work with the new wiki elements
Some checks failed
Build and push / changes (push) Successful in 7s
Build and push / Lint-Python (push) Successful in 10s
Build and push / Build-and-Push-Docker (push) Failing after 18s
Build and push / sync-argocd-app (push) Has been skipped

This commit is contained in:
Luke Robles 2024-11-10 21:12:03 -08:00
parent e836e57de9
commit 81b71e4bce

View File

@ -261,8 +261,10 @@ async def get_ship(ship_name):
) )
try: try:
pledge_price = ( pledge_price = (
soup.find("div", {"class": "infobox__label"}, string="Standalone") soup.find(
.findNext("span", {"class": "smwtext"}) "span", {"class": "ext-floatingui-reference"}, string="Standalone"
)
.findNext("div", {"class": "infobox__data"})
.text .text
) )
except Exception: except Exception:
@ -413,8 +415,10 @@ async def get_ship(ship_name):
embed.add_field(name="-------", value="", inline=False) embed.add_field(name="-------", value="", inline=False)
try: try:
length = ( length = (
soup.find("div", {"class": "infobox__label"}, string="Length") soup.find(
.findNext("span", {"class": "smwtext"}) "div", {"class": "template-dimensions-label"}, string="Length"
)
.findNext("div", {"class": "template-dimensions-data"})
.text .text
) )
except Exception: except Exception:
@ -424,8 +428,8 @@ async def get_ship(ship_name):
try: try:
width = ( width = (
soup.find("div", {"class": "infobox__label"}, string="Width") soup.find("div", {"class": "template-dimensions-label"}, string="Width")
.findNext("span", {"class": "smwtext"}) .findNext("div", {"class": "template-dimensions-data"})
.text .text
) )
except Exception: except Exception:
@ -435,8 +439,10 @@ async def get_ship(ship_name):
try: try:
height = ( height = (
soup.find("div", {"class": "infobox__label"}, string="Height") soup.find(
.findNext("span", {"class": "smwtext"}) "div", {"class": "template-dimensions-label"}, string="Height"
)
.findNext("div", {"class": "template-dimensions-data"})
.text .text
) )
except Exception: except Exception: