diff --git a/telebot/apihelper.py b/telebot/apihelper.py index 5ea37c4fd..3044b226d 100644 --- a/telebot/apihelper.py +++ b/telebot/apihelper.py @@ -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 diff --git a/telebot/asyncio_helper.py b/telebot/asyncio_helper.py index 56604c750..d11245d56 100644 --- a/telebot/asyncio_helper.py +++ b/telebot/asyncio_helper.py @@ -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