diff --git a/ops_bot/aws.py b/ops_bot/aws.py index c3a9170..0441cd2 100644 --- a/ops_bot/aws.py +++ b/ops_bot/aws.py @@ -34,16 +34,22 @@ def handle_json_notification(payload: Any, body: Any) -> Tuple[str, str]: subject = payload.get("Subject") state_value = payload.get("NewStateValue", "unknown") - plain = f"{subject}\n{description}" if state_value == "ALARM": color = COLOR_ALARM elif state_value == "OK": color = COLOR_OK else: color = COLOR_UNKNOWN - formatted = ( - f"{subject}\n
{description}
" - ) + + plain = f"{subject}" + formatted = f"{subject}\n" + + if state_value == "OK": + plain += "\n(this alarm has been resolved!)" + formatted += "\n(this alarm has been resolved!)
" + else: + plain += "\n{description}" + formatted += f"\n{description}
" return plain, formatted