Fix issue with un-buyable ships causing the bot to error

This commit is contained in:
Luke Robles 2023-07-09 16:35:41 -07:00
parent c73169c6a1
commit 27b4e0e3f9
9 changed files with 14 additions and 11 deletions

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

0
app/cogs/actual_utils.py Executable file → Normal file
View File

0
app/cogs/stable_diffusion.py Normal file → Executable file
View File

0
app/requirements.txt Normal file → Executable file
View File

25
app/star_citizen.py Normal file → Executable file
View File

@ -105,19 +105,22 @@ async def get_ship(ship_name):
inline=True,
)
buy_location = (
soup.find("span", {"id": "Universe_availability"})
.findNext("tbody")
.find_all("td", {"class", "Location smwtype_wpg"})
)
if len(buy_location):
embed.add_field(
name="**Buyable At**",
value=", ".join(str(x.text) for x in buy_location),
inline=True,
try:
buy_location = (
soup.find("span", {"id": "Universe_availability"})
.findNext("tbody")
.find_all("td", {"class", "Location smwtype_wpg"})
)
if len(buy_location):
embed.add_field(
name="**Buyable At**",
value=", ".join(str(x.text) for x in buy_location),
inline=True,
)
except Exception:
pass
embed.add_field(name="-------", value="", inline=False)
try:
cargo_capacity = (

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

0
argocd-application.yaml Normal file → Executable file
View File

0
helm/values.yaml Normal file → Executable file
View File

0
test-dragon-bot.sh Normal file → Executable file
View File