Spaces:
Paused
Paused
hotfix: fix webhook
Browse files
app.py
CHANGED
@@ -199,12 +199,12 @@ def summary(webhook_url, disable_discord, env, username, state):
|
|
199 |
if len(word) + 1 + len(chunk) < 2000:
|
200 |
chunk += word + " "
|
201 |
else:
|
202 |
-
r = requests.post(
|
203 |
r.raise_for_status()
|
204 |
chunk = ""
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
except Exception:
|
209 |
return "Error: webhook discord failed"
|
210 |
elif env == Env.CHALLENGE_HARD:
|
|
|
199 |
if len(word) + 1 + len(chunk) < 2000:
|
200 |
chunk += word + " "
|
201 |
else:
|
202 |
+
r = requests.post(webhook_url, json={"content": chunk, "allowed_mentions": {"parse": []}})
|
203 |
r.raise_for_status()
|
204 |
chunk = ""
|
205 |
+
if chunk:
|
206 |
+
r = requests.post(webhook_url, json={"content": chunk, "allowed_mentions": {"parse": []}})
|
207 |
+
r.raise_for_status()
|
208 |
except Exception:
|
209 |
return "Error: webhook discord failed"
|
210 |
elif env == Env.CHALLENGE_HARD:
|