1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Fix set_sticker_set_thumb and set_sticker_set_thumbnail

This commit is contained in:
Badiboy
2023-03-25 14:56:31 +03:00
parent e56c60ac00
commit 6a9c25cf80
4 changed files with 25 additions and 28 deletions

View File

@@ -4547,8 +4547,7 @@ class TeleBot:
"""
return apihelper.answer_callback_query(self.token, callback_query_id, text, show_alert, url, cache_time)
def set_sticker_set_thumbnail(
self, name: str, user_id: int, thumb: Union[Any, str]=None):
def set_sticker_set_thumbnail(self, name: str, user_id: int, thumbnail: Union[Any, str]=None):
"""
Use this method to set the thumbnail of a sticker set.
Animated thumbnails can be set for animated sticker sets only. Returns True on success.
@@ -4561,16 +4560,17 @@ class TeleBot:
:param user_id: User identifier
:type user_id: :obj:`int`
:param thumb:
:type thumb: :obj:`filelike object`
:param thumbnail: A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
:type thumbnail: :obj:`filelike object`
:return: On success, True is returned.
:rtype: :obj:`bool`
"""
return apihelper.set_sticker_set_thumb(self.token, name, user_id, thumb)
return apihelper.set_sticker_set_thumbnail(self.token, name, user_id, thumbnail)
def set_sticker_set_thumb(
self, name: str, user_id: int, thumb: Union[Any, str]=None):
@util.deprecated(deprecation_text="Use set_sticker_set_thumbnail instead")
def set_sticker_set_thumb(self, name: str, user_id: int, thumb: Union[Any, str]=None):
"""
Use this method to set the thumbnail of a sticker set.
Animated thumbnails can be set for animated sticker sets only. Returns True on success.
@@ -4590,8 +4590,7 @@ class TeleBot:
:rtype: :obj:`bool`
"""
# deprecated
logger.warning('set_sticker_set_thumb is deprecated. Use set_sticker_set_thumbnail instead.')
return apihelper.set_sticker_set_thumb(self.token, name, user_id, thumb)
return self.set_sticker_set_thumbnail(name, user_id, thumb)
def get_sticker_set(self, name: str) -> types.StickerSet:
"""