Fixed possible incorrect escaping of list[str].

By default if you call str() on collection python will escape strings inside of it using single quotes, which will cause "Can't parse custom emoji identifiers json object" error when calling getCustomEmojiStickers.
json.dumps() escapes strings by double quotes so no error occurs.
This commit is contained in:
ENCRYPTED 2022-09-17 21:08:59 +03:00 committed by GitHub
parent 96ebee26e4
commit 492657b1e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -166,7 +166,10 @@ def compose_data(params=None, files=None):
if params:
for key, value in params.items():
data.add_field(key, str(value))
if isinstance(value, (list, dict)):
data.add_field(key, json.dumps(value))
else:
data.add_field(key, str(value))
if files:
for key, f in files.items():