Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coder2020official committed Aug 13, 2022
1 parent 2647a02 commit ffb34da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4281,10 +4281,8 @@ def create_new_sticker_set(
"""
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,
Expand Down
8 changes: 3 additions & 5 deletions telebot/async_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5119,11 +5119,9 @@ async def create_new_sticker_set(
"""
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)
Expand Down

0 comments on commit ffb34da

Please sign in to comment.