diff --git a/telebot/__init__.py b/telebot/__init__.py index 7719fa0..ee1cc55 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -4281,10 +4281,8 @@ class TeleBot: """ if contains_masks is not None: logger.warning('The parameter "contains_masks" is deprecated, use "sticker_type" instead') - if contains_masks: - sticker_type = 'mask' - else: - sticker_type = 'regular' + if sticker_type is None: + sticker_type = 'mask' if contains_masks else 'regular' return apihelper.create_new_sticker_set( self.token, user_id, name, title, emojis, png_sticker, tgs_sticker, diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index 72561fa..f8be968 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -5119,11 +5119,9 @@ class AsyncTeleBot: """ if contains_masks is not None: logger.warning('The parameter "contains_masks" is deprecated, use "sticker_type" instead') - if contains_masks: - sticker_type = 'mask' - else: - sticker_type = 'regular' - + if sticker_type is None: + sticker_type = 'mask' if contains_masks else 'regular' + return await asyncio_helper.create_new_sticker_set( self.token, user_id, name, title, emojis, png_sticker, tgs_sticker, mask_position, webm_sticker, sticker_type)