Add ship health to /ship command
This commit is contained in:
parent
25c47a06dd
commit
532f8e6841
0
app/bot.py
Normal file → Executable file
0
app/bot.py
Normal file → Executable file
@ -192,6 +192,17 @@ async def get_ship(ship_name):
|
|||||||
cargo_capacity = "N/A"
|
cargo_capacity = "N/A"
|
||||||
embed.add_field(name="**Cargo Capacity**", value=cargo_capacity, inline=True)
|
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:
|
try:
|
||||||
top_speed = (
|
top_speed = (
|
||||||
soup.find("div", {"class": "infobox__label"}, string="Max speed")
|
soup.find("div", {"class": "infobox__label"}, string="Max speed")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user