From 27b4e0e3f9aa7e1aa0557b55140031313afea794 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Sun, 9 Jul 2023 16:35:41 -0700 Subject: [PATCH] Fix issue with un-buyable ships causing the bot to error --- app/bot.py | 0 app/cogs/actual_utils.py | 0 app/cogs/stable_diffusion.py | 0 app/requirements.txt | 0 app/star_citizen.py | 25 ++++++++++++++----------- app/stock.py | 0 argocd-application.yaml | 0 helm/values.yaml | 0 test-dragon-bot.sh | 0 9 files changed, 14 insertions(+), 11 deletions(-) mode change 100644 => 100755 app/bot.py mode change 100755 => 100644 app/cogs/actual_utils.py mode change 100644 => 100755 app/cogs/stable_diffusion.py mode change 100644 => 100755 app/requirements.txt mode change 100644 => 100755 app/star_citizen.py mode change 100644 => 100755 app/stock.py mode change 100644 => 100755 argocd-application.yaml mode change 100644 => 100755 helm/values.yaml mode change 100644 => 100755 test-dragon-bot.sh diff --git a/app/bot.py b/app/bot.py old mode 100644 new mode 100755 diff --git a/app/cogs/actual_utils.py b/app/cogs/actual_utils.py old mode 100755 new mode 100644 diff --git a/app/cogs/stable_diffusion.py b/app/cogs/stable_diffusion.py old mode 100644 new mode 100755 diff --git a/app/requirements.txt b/app/requirements.txt old mode 100644 new mode 100755 diff --git a/app/star_citizen.py b/app/star_citizen.py old mode 100644 new mode 100755 index 6ced8486..f18dd978 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -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 = ( diff --git a/app/stock.py b/app/stock.py old mode 100644 new mode 100755 diff --git a/argocd-application.yaml b/argocd-application.yaml old mode 100644 new mode 100755 diff --git a/helm/values.yaml b/helm/values.yaml old mode 100644 new mode 100755 diff --git a/test-dragon-bot.sh b/test-dragon-bot.sh old mode 100644 new mode 100755