Fixed get_custom_emoji_stickers method (#1002)

* 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.

* get_custom_emoji_stickers docstring fix

* Revert compose_data changes

* Correctly fixed get_custom_emoji_stickers method
This commit is contained in:
ENCRYPTED 2022-09-18 16:59:25 +03:00 committed by GitHub
parent e065285857
commit 95dc3fc533
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3051,13 +3051,14 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
Use this method to get information about custom emoji stickers by their identifiers.
Source: https://core.telegram.org/bots/api#uploadstickerfile
Source: https://core.telegram.org/bots/api#getcustomemojistickers
:param custom_emoji_ids: User identifier of sticker file owner
:param custom_emoji_ids: List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
:type custom_emoji_ids: :obj:`typing.List[base.String]`
:return: Returns an Array of Sticker objects.
:rtype: :obj:`typing.List[types.Sticker]`
"""
custom_emoji_ids = prepare_arg(custom_emoji_ids)
payload = generate_payload(**locals())
result = await self.request(api.Methods.GET_CUSTOM_EMOJI_STICKERS, payload)