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

Bot API 6.2

This commit is contained in:
_run
2022-08-12 22:10:08 +05:00
parent ffa1c37204
commit 40698408c9
5 changed files with 90 additions and 15 deletions

View File

@@ -4190,6 +4190,20 @@ class TeleBot:
result = apihelper.get_sticker_set(self.token, name)
return types.StickerSet.de_json(result)
def get_custom_emoji_stickers(self, custom_emoji_ids: List[str]) -> List[types.Sticker]:
"""
Use this method to get information about custom emoji stickers by their identifiers.
Returns an Array of Sticker objects.
:param custom_emoji_ids: List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
:type custom_emoji_ids: :obj:`list` of :obj:`str`
:return: Returns an Array of Sticker objects.
:rtype: :obj:`list` of :class:`telebot.types.Sticker`
"""
result = apihelper.get_custom_emoji_stickers(self.token, custom_emoji_ids)
return [types.Sticker.de_json(sticker) for sticker in result]
def upload_sticker_file(self, user_id: int, png_sticker: Union[Any, str]) -> types.File:
"""
Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet
@@ -4217,6 +4231,7 @@ class TeleBot:
tgs_sticker: Union[Any, str]=None,
webm_sticker: Union[Any, str]=None,
contains_masks: Optional[bool]=None,
sticker_type: Optional[str]=None,
mask_position: Optional[types.MaskPosition]=None) -> bool:
"""
Use this method to create new sticker set owned by a user.
@@ -4250,9 +4265,14 @@ class TeleBot:
:param webm_sticker: WebM animation with the sticker, uploaded using multipart/form-data.
:type webm_sticker: :obj:`str`
:param contains_masks: Pass True, if a set of mask stickers should be created
:param contains_masks: Pass True, if a set of mask stickers should be created. Deprecated since Bot API 6.2,
use sticker_type instead.
:type contains_masks: :obj:`bool`
:param sticker_type: Optional, Type of stickers in the set, pass “regular” or “mask”. Custom emoji sticker sets can't be created
via the Bot API at the moment. By default, a regular sticker set is created.
:type sticker_type: :obj:`str`
:param mask_position: A JSON-serialized object for position where the mask should be placed on faces
:type mask_position: :class:`telebot.types.MaskPosition`
@@ -4261,7 +4281,7 @@ class TeleBot:
"""
return apihelper.create_new_sticker_set(
self.token, user_id, name, title, emojis, png_sticker, tgs_sticker,
contains_masks, mask_position, webm_sticker)
contains_masks, mask_position, webm_sticker, sticker_type)
def add_sticker_to_set(
self, user_id: int, name: str, emojis: str,