diff --git a/telebot/__init__.py b/telebot/__init__.py index fd70d3a..a2cfb31 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -4580,6 +4580,23 @@ class TeleBot: :rtype: :obj:`bool` """ return apihelper.set_custom_emoji_sticker_set_thumbnail(self.token, name, custom_emoji_id) + + def set_sticker_set_title(self, name: str, title: str): + """ + Use this method to set the title of a created sticker set. + Returns True on success. + + :param name: Sticker set name + :type name: :obj:`str` + + :param title: New sticker set title + :type title: :obj:`str` + + :return: Returns True on success. + :rtype: :obj:`bool` + """ + + return apihelper.set_sticker_set_title(self.token, name, title) def upload_sticker_file(self, user_id: int, png_sticker: Union[Any, str]=None, sticker: Optional[types.InputFile]=None, sticker_format: Optional[str]=None) -> types.File: """ diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 3f65fa6..9a264b9 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -1635,6 +1635,12 @@ def set_custom_emoji_sticker_set_thumbnail(token, name, custom_emoji_id=None): payload['custom_emoji_id'] = custom_emoji_id return _make_request(token, method_url, params=payload, method='post') + +def set_sticker_set_title(token, name, title): + method_url = 'setStickerSetTitle' + payload = {'name': name, 'title': title} + return _make_request(token, method_url, params=payload, method='post') + def create_new_sticker_set( token, user_id, name, title, stickers, sticker_format=None, sticker_type=None, needs_repainting=None): method_url = 'createNewStickerSet' diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index a98f64d..608d880 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -5474,6 +5474,24 @@ class AsyncTeleBot: :rtype: :obj:`bool` """ return await asyncio_helper.set_custom_emoji_sticker_set_thumbnail(self.token, name, custom_emoji_id) + + async def set_sticker_set_title(self, name: str, title: str): + """ + Use this method to set the title of a created sticker set. + Returns True on success. + + :param name: Sticker set name + :type name: :obj:`str` + + :param title: New sticker set title + :type title: :obj:`str` + + :return: Returns True on success. + :rtype: :obj:`bool` + """ + + return await asyncio_helper.set_sticker_set_title(self.token, name, title) + async def create_new_sticker_set( self, user_id: int, name: str, title: str, diff --git a/telebot/asyncio_helper.py b/telebot/asyncio_helper.py index a5d08cf..2018757 100644 --- a/telebot/asyncio_helper.py +++ b/telebot/asyncio_helper.py @@ -1622,6 +1622,12 @@ async def set_custom_emoji_sticker_set_thumbnail(token, name, custom_emoji_id=No payload['custom_emoji_id'] = custom_emoji_id return await _process_request(token, method_url, params=payload, method='post') + +async def set_sticker_set_title(token, name, title): + method_url = 'setStickerSetTitle' + payload = {'name': name, 'title': title} + return await _process_request(token, method_url, params=payload, method='post') + async def create_new_sticker_set( token, user_id, name, title, stickers, sticker_format=None, sticker_type=None, needs_repainting=None): method_url = 'createNewStickerSet'