From 6ecfd1b00ce8135bf7a0194e3c39c745590b18ed Mon Sep 17 00:00:00 2001 From: Heck Lawert Date: Mon, 9 Dec 2024 10:02:49 +0100 Subject: [PATCH] Fix issue with thumbnail in InputMedia types --- telebot/apihelper.py | 6 ++++++ 1 file changed, 6 insertions(+) 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