Fix webhook notification by adding User-Agent header
Discord webhooks require a User-Agent header or they return 403 Forbidden. Added 'Paper-Dynasty-Discord-Bot/1.0' as User-Agent. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4c39e9c0ce
commit
d31ca7d7e5
@ -34,7 +34,10 @@ def send_restart_notification():
|
||||
req = urllib.request.Request(
|
||||
webhook_url,
|
||||
data=json.dumps(data).encode("utf-8"),
|
||||
headers={"Content-Type": "application/json"},
|
||||
headers={
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": "Paper-Dynasty-Discord-Bot/1.0",
|
||||
},
|
||||
)
|
||||
|
||||
response = urllib.request.urlopen(req, timeout=5)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user