Pārlūkot izejas kodu

Add @here to 10 mins alert for UR

Foppe Hemminga 6 gadi atpakaļ
vecāks
revīzija
bdb310b830
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      view.py

+ 2 - 0
view.py

@@ -32,6 +32,8 @@ def _send(send_json):
     webhooks = json.loads(webhooks_json)
     for webhook_key in webhooks:
         webhook = webhooks[webhook_key]
+        if 'Alert: 10 mins' in send_json['content'] and webhook_key == 'Unrelenting':
+            send_json['content'] = '@here ' + send_json['content']
         url = base_url+webhook
         response = requests.post(url, json=send_json)
         if response.status_code in [200, 204]: