Skip to content

Commit

Permalink
Fixed get_custom_emoji_stickers method (#1002)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ENCRYPTEDFOREVER committed Sep 18, 2022
1 parent e065285 commit 95dc3fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aiogram/bot/bot.py
Expand Up @@ -3051,13 +3051,14 @@ async def get_custom_emoji_stickers(self, custom_emoji_ids: typing.List[base.Str
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)
Expand Down

0 comments on commit 95dc3fc

Please sign in to comment.