File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
pyrogram/methods/messages Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ def progress(current, total):
201201 thumb = await self .save_file (thumb )
202202 file = await self .save_file (animation , progress = progress , progress_args = progress_args )
203203 media = raw .types .InputMediaUploadedDocument (
204- mime_type = self .guess_mime_type (animation .name ) or "video/mp4" ,
204+ mime_type = self .guess_mime_type (file_name or animation .name ) or "video/mp4" ,
205205 file = file ,
206206 thumb = thumb ,
207207 attributes = [
@@ -211,7 +211,7 @@ def progress(current, total):
211211 w = width ,
212212 h = height
213213 ),
214- raw .types .DocumentAttributeFilename (file_name = animation .name ),
214+ raw .types .DocumentAttributeFilename (file_name = file_name or animation .name ),
215215 raw .types .DocumentAttributeAnimated ()
216216 ]
217217 )
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ def progress(current, total):
197197 thumb = await self .save_file (thumb )
198198 file = await self .save_file (audio , progress = progress , progress_args = progress_args )
199199 media = raw .types .InputMediaUploadedDocument (
200- mime_type = self .guess_mime_type (audio .name ) or "audio/mpeg" ,
200+ mime_type = self .guess_mime_type (file_name or audio .name ) or "audio/mpeg" ,
201201 file = file ,
202202 thumb = thumb ,
203203 attributes = [
@@ -206,7 +206,7 @@ def progress(current, total):
206206 performer = performer ,
207207 title = title
208208 ),
209- raw .types .DocumentAttributeFilename (file_name = audio .name )
209+ raw .types .DocumentAttributeFilename (file_name = file_name or audio .name )
210210 ]
211211 )
212212
Original file line number Diff line number Diff line change @@ -180,11 +180,11 @@ def progress(current, total):
180180 thumb = await self .save_file (thumb )
181181 file = await self .save_file (document , progress = progress , progress_args = progress_args )
182182 media = raw .types .InputMediaUploadedDocument (
183- mime_type = self .guess_mime_type (document .name ) or "application/zip" ,
183+ mime_type = self .guess_mime_type (file_name or document .name ) or "application/zip" ,
184184 file = file ,
185185 thumb = thumb ,
186186 attributes = [
187- raw .types .DocumentAttributeFilename (file_name = document .name )
187+ raw .types .DocumentAttributeFilename (file_name = file_name or document .name )
188188 ]
189189 )
190190
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ def progress(current, total):
207207 thumb = await self .save_file (thumb )
208208 file = await self .save_file (video , progress = progress , progress_args = progress_args )
209209 media = raw .types .InputMediaUploadedDocument (
210- mime_type = self .guess_mime_type (video .name ) or "video/mp4" ,
210+ mime_type = self .guess_mime_type (file_name or video .name ) or "video/mp4" ,
211211 file = file ,
212212 ttl_seconds = ttl_seconds ,
213213 thumb = thumb ,
@@ -218,7 +218,7 @@ def progress(current, total):
218218 w = width ,
219219 h = height
220220 ),
221- raw .types .DocumentAttributeFilename (file_name = video .name )
221+ raw .types .DocumentAttributeFilename (file_name = file_name or video .name )
222222 ]
223223 )
224224
You can’t perform that action at this time.
0 commit comments