aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-05-01 09:22:50 -0400
committerRapptz <[email protected]>2021-05-01 09:24:40 -0400
commit60c1240849fc6e8c4ea313469bfd4824fd272cb9 (patch)
tree5ee9618ddc661ce550cb061de07a0dd5fac38d41
parentFix sending multipart data with SyncWebhook (diff)
downloaddiscord.py-60c1240849fc6e8c4ea313469bfd4824fd272cb9.tar.xz
discord.py-60c1240849fc6e8c4ea313469bfd4824fd272cb9.zip
Fix SyncWebhook exception case causing attribute errors
-rw-r--r--discord/webhook/sync.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py
index eb79022c..1fd05f3e 100644
--- a/discord/webhook/sync.py
+++ b/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)