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 9, 2024
1 parent 3987372 commit 6ecfd1b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions telebot/apihelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2271,6 +2271,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

0 comments on commit 6ecfd1b

Please sign in to comment.