Skip to content

Commit

Permalink
[Status] Fix some super weird embed colour bug
Browse files Browse the repository at this point in the history
dont worry, it was non-breaking
  • Loading branch information
Vexed01 committed Mar 12, 2021
1 parent e300b41 commit 1ec1525
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions status/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,21 +454,22 @@ async def _make_send_cache(self, feeddict, service: str):
}

def _get_colour(self, feeddict: dict, service: str):
if service in DONT_REVERSE:
if service in DONT_REVERSE or service in ["aws", "gcp"]: # only do this for statuspage ones
return feeddict.get("colour")

try:
last_title = feeddict["fields"][0]["name"]
status = last_title.split(" ")[0].lower()
if status == "investigating":
return discord.Color.red()
elif status == ("update" or "identified" or "monitoring"):
elif status in ["update", "identified", "monitoring"]:
return discord.Color.orange()
elif status == "resolved":
return discord.Color.green()
else:
return feeddict.get("colour")
except Exception:
except Exception as e: # hopefully never happens but will keep this for a while
log.error(f"Error with getting correct colour for {service}:", exc_info=e)
return feeddict.get("colour")

async def _send_updated_feed(self, feeddict: dict, channel: tuple, service: str):
Expand Down

0 comments on commit 1ec1525

Please sign in to comment.