|
|
@@ -1,7 +1,7 @@
|
|
|
import json
|
|
|
import os
|
|
|
-# import requests
|
|
|
-# import sys
|
|
|
+import requests
|
|
|
+import sys
|
|
|
from dotenv import load_dotenv
|
|
|
from pprint import pprint
|
|
|
|
|
|
@@ -20,10 +20,10 @@ def broadcast(this_text):
|
|
|
pprint(this_json)
|
|
|
url = base_url+webhook
|
|
|
print(url)
|
|
|
- # response = requests.post(url, json=this_json)
|
|
|
- # if response.status_code in [200, 204]:
|
|
|
- # print("Webhook executed")
|
|
|
- # else:
|
|
|
- # print("status code {}: {}".format(response.status_code, response.content.decode("utf-8")))
|
|
|
- # if response.status_code == int(429):
|
|
|
- # sys.exit(1)
|
|
|
+ response = requests.post(url, json=this_json)
|
|
|
+ if response.status_code in [200, 204]:
|
|
|
+ print("Webhook executed")
|
|
|
+ else:
|
|
|
+ print("status code {}: {}".format(response.status_code, response.content.decode("utf-8")))
|
|
|
+ if response.status_code == int(429):
|
|
|
+ sys.exit(1)
|