File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2271,6 +2271,12 @@ def convert_input_media_array(array):
2271
2271
if media_dict ['media' ].startswith ('attach://' ):
2272
2272
key = media_dict ['media' ].replace ('attach://' , '' )
2273
2273
files [key ] = input_media .media
2274
+ if 'thumbnail' in media_dict :
2275
+ thumbnail = media_dict ['thumbnail' ]
2276
+ if isinstance (thumbnail , types .InputFile ):
2277
+ thumbnail_key = 'thumbnail_' + key
2278
+ files [thumbnail_key ] = thumbnail
2279
+ media_dict ['thumbnail' ] = 'attach://' + thumbnail_key
2274
2280
media .append (media_dict )
2275
2281
return json .dumps (media ), files
2276
2282
Original file line number Diff line number Diff line change @@ -2243,6 +2243,12 @@ async def convert_input_media_array(array):
2243
2243
if media_dict ['media' ].startswith ('attach://' ):
2244
2244
key = media_dict ['media' ].replace ('attach://' , '' )
2245
2245
files [key ] = input_media .media
2246
+ if 'thumbnail' in media_dict :
2247
+ thumbnail = media_dict ['thumbnail' ]
2248
+ if isinstance (thumbnail , types .InputFile ):
2249
+ thumbnail_key = 'thumbnail_' + key
2250
+ files [thumbnail_key ] = thumbnail
2251
+ media_dict ['thumbnail' ] = 'attach://' + thumbnail_key
2246
2252
media .append (media_dict )
2247
2253
return json .dumps (media ), files
2248
2254
You can’t perform that action at this time.
0 commit comments