Skip to content

Commit

Permalink
Fix issue with thumbnail in InputMedia types
Browse files Browse the repository at this point in the history
  • Loading branch information
hecklawert committed Dec 12, 2024
1 parent 6ecfd1b commit 63ddb15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions telebot/asyncio_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2243,6 +2243,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

0 comments on commit 63ddb15

Please sign in to comment.