21 lines
800 B
Python
21 lines
800 B
Python
import urllib.request
|
|
import json
|
|
import ssl
|
|
|
|
ctx = ssl.create_default_context()
|
|
ctx.check_hostname = False
|
|
ctx.verify_mode = ssl.CERT_NONE
|
|
|
|
webhook_url = "https://discord.com/api/webhooks/1566076777963593772/wKN30N0ZXVJKGP-prZ1_P9cp_u7Oakmh8R4bVh0qr8RFpyeGcJZrHfPQBJxtfzQqb4dn"
|
|
payload = {
|
|
"content": "✅ **[SnarfNet Ops] Alerting Audit: Discord Webhook Verification**\n- Testing `#infra-alerts` channel delivery."
|
|
}
|
|
req = urllib.request.Request(webhook_url, data=json.dumps(payload).encode('utf-8'),
|
|
headers={"Content-Type": "application/json", "User-Agent": "SnarfNetOps/1.0"})
|
|
try:
|
|
resp = urllib.request.urlopen(req, context=ctx, timeout=10)
|
|
print("Discord Webhook Status:", resp.getcode())
|
|
except Exception as e:
|
|
print("Discord Webhook Error:", e)
|
|
|