Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
coder2020official committed Jan 3, 2025
1 parent b0afe2d commit ebb291a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions telebot/apihelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,12 @@ def convert_input_media_array(array):
if media_dict['media'].startswith('attach://'):
key = media_dict['media'].replace('attach://', '')
files[key] = input_media.media
if 'thumbnail' in media_dict:
thumbnail = media_dict['thumbnail']
if isinstance(thumbnail, types.InputFile):
thumbnail_key = 'thumbnail_' + key
files[thumbnail_key] = thumbnail
media_dict['thumbnail'] = 'attach://' + thumbnail_key
media.append(media_dict)
return json.dumps(media), files

Expand Down
4 changes: 2 additions & 2 deletions telebot/async_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7752,7 +7752,7 @@ async def verify_user(self, user_id: int, custom_description: Optional[str]=None
:return: Returns True on success.
:rtype: :obj:`bool`
"""
return await asyncio_helper.verify_user(self.token, user_id, custom_description)
return await asyncio_helper.verify_user(self.token, user_id, custom_description=custom_description)

async def verify_chat(self, chat_id: Union[int, str], custom_description: Optional[str]=None) -> bool:
"""
Expand All @@ -7770,7 +7770,7 @@ async def verify_chat(self, chat_id: Union[int, str], custom_description: Option
:rtype: :obj:`bool`
"""

return await asyncio_helper.verify_chat(self.token, chat_id, custom_description)
return await asyncio_helper.verify_chat(self.token, chat_id, custom_description=custom_description)

async def remove_user_verification(self, user_id: int) -> bool:
"""
Expand Down
6 changes: 6 additions & 0 deletions telebot/asyncio_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2269,6 +2269,12 @@ async def convert_input_media_array(array):
if media_dict['media'].startswith('attach://'):
key = media_dict['media'].replace('attach://', '')
files[key] = input_media.media
if 'thumbnail' in media_dict:
thumbnail = media_dict['thumbnail']
if isinstance(thumbnail, types.InputFile):
thumbnail_key = 'thumbnail_' + key
files[thumbnail_key] = thumbnail
media_dict['thumbnail'] = 'attach://' + thumbnail_key
media.append(media_dict)
return json.dumps(media), files

Expand Down
2 changes: 1 addition & 1 deletion telebot/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Versions should comply with PEP440.
# This line is parsed in setup.py:
__version__ = '4.24.0'
__version__ = '4.25.0'

0 comments on commit ebb291a

Please sign in to comment.