Add ship health to /ship command

This commit is contained in:
Luke Robles 2023-11-30 08:10:06 -08:00
parent 25c47a06dd
commit 532f8e6841
2 changed files with 11 additions and 0 deletions

0
app/bot.py Normal file → Executable file
View File

View File

@ -192,6 +192,17 @@ async def get_ship(ship_name):
cargo_capacity = "N/A"
embed.add_field(name="**Cargo Capacity**", value=cargo_capacity, inline=True)
try:
health = (
soup.find("div", {"class": "infobox__label"}, string="Health")
.findNext("div", {"class": "infobox__data"})
.text
)
except Exception:
health = "N/A"
embed.add_field(name="**Ship Health**", value=health, inline=True)
try:
top_speed = (
soup.find("div", {"class": "infobox__label"}, string="Max speed")