Browse Source

Fix SyncWebhook exception case causing attribute errors

pull/6836/head
Rapptz 4 years ago
parent
commit
60c1240849
  1. 3
      discord/webhook/sync.py

3
discord/webhook/sync.py

@ -156,6 +156,9 @@ class WebhookAdapter:
response.status_code,
)
response.encoding = 'utf-8'
# Compatibility with aiohttp
response.status = response.status_code # type: ignore
data = response.text or None
if data and response.headers['Content-Type'] == 'application/json':
data = json.loads(data)

Loading…
Cancel
Save