Browse Source

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 <[email protected]>
pull/10109/head
AgitoReiKen 3 years ago
committed by GitHub
parent
commit
0a961adcd6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      discord/http.py

2
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)

Loading…
Cancel
Save