From 0a961adcd6081879d402b0cc664f7e4accda6463 Mon Sep 17 00:00:00 2001 From: AgitoReiKen <42333163+AgitoReiKen@users.noreply.github.com> Date: Wed, 6 Apr 2022 04:33:36 +0900 Subject: [PATCH] BadRequest fix for new discord update (#271) discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In _errors: [{'code': 'DICT_TYPE_CONVERT', 'message': 'Only dictionaries may be used in a DictType'}] Co-authored-by: agitoreiken --- discord/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/http.py b/discord/http.py index a3c8a55c4..9960dc88f 100644 --- a/discord/http.py +++ b/discord/http.py @@ -470,7 +470,7 @@ class HTTPClient: if reason: headers['X-Audit-Log-Reason'] = _uriquote(reason) - if payload := kwargs.pop('json', None) is not None: + if (payload := kwargs.pop('json', None)) is not None: headers['Content-Type'] = 'application/json' kwargs['data'] = utils._to_json(payload)