Ver código fonte

Add @here to 10 mins alert for UR

Foppe Hemminga 6 anos atrás
pai
commit
bdb310b830
1 arquivos alterados com 2 adições e 0 exclusões
  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]: