@@ -252,6 +252,7 @@ def forwardMessage(self,
252252 def sendPhoto (self ,
253253 chat_id ,
254254 photo ,
255+ filename = None ,
255256 caption = None ,
256257 ** kwargs ):
257258 """Use this method to send photos.
@@ -263,6 +264,9 @@ def sendPhoto(self,
263264 Photo to send. You can either pass a file_id as String to resend a
264265 photo that is already on the Telegram servers, or upload a new
265266 photo using multipart/form-data.
267+ filename:
268+ File name that shows in telegram message (it is usefull when you
269+ send file generated by temp module, for example). [Optional]
266270 caption:
267271 Photo caption (may also be used when resending photos by file_id).
268272 [Optional]
@@ -282,6 +286,8 @@ def sendPhoto(self,
282286 data = {'chat_id' : chat_id ,
283287 'photo' : photo }
284288
289+ if filename :
290+ data ['filename' ] = filename
285291 if caption :
286292 data ['caption' ] = caption
287293
@@ -292,6 +298,7 @@ def sendPhoto(self,
292298 def sendAudio (self ,
293299 chat_id ,
294300 audio ,
301+ filename = None ,
295302 duration = None ,
296303 performer = None ,
297304 title = None ,
@@ -314,6 +321,9 @@ def sendAudio(self,
314321 Audio file to send. You can either pass a file_id as String to
315322 resend an audio that is already on the Telegram servers, or upload
316323 a new audio file using multipart/form-data.
324+ filename:
325+ File name that shows in telegram message (it is usefull when you
326+ send file generated by temp module, for example). [Optional]
317327 duration:
318328 Duration of sent audio in seconds. [Optional]
319329 performer:
@@ -336,6 +346,8 @@ def sendAudio(self,
336346 data = {'chat_id' : chat_id ,
337347 'audio' : audio }
338348
349+ if filename :
350+ data ['filename' ] = filename
339351 if duration :
340352 data ['duration' ] = duration
341353 if performer :
@@ -350,6 +362,7 @@ def sendAudio(self,
350362 def sendDocument (self ,
351363 chat_id ,
352364 document ,
365+ filename = None ,
353366 ** kwargs ):
354367 """Use this method to send general files.
355368
@@ -360,6 +373,9 @@ def sendDocument(self,
360373 File to send. You can either pass a file_id as String to resend a
361374 file that is already on the Telegram servers, or upload a new file
362375 using multipart/form-data.
376+ filename:
377+ File name that shows in telegram message (it is usefull when you
378+ send file generated by temp module, for example). [Optional]
363379 reply_to_message_id:
364380 If the message is a reply, ID of the original message. [Optional]
365381 reply_markup:
@@ -376,13 +392,17 @@ def sendDocument(self,
376392 data = {'chat_id' : chat_id ,
377393 'document' : document }
378394
395+ if filename :
396+ data ['filename' ] = filename
397+
379398 return url , data
380399
381400 @log
382401 @message
383402 def sendSticker (self ,
384403 chat_id ,
385404 sticker ,
405+ filename = None ,
386406 ** kwargs ):
387407 """Use this method to send .webp stickers.
388408
@@ -393,6 +413,9 @@ def sendSticker(self,
393413 Sticker to send. You can either pass a file_id as String to resend
394414 a sticker that is already on the Telegram servers, or upload a new
395415 sticker using multipart/form-data.
416+ filename:
417+ File name that shows in telegram message (it is usefull when you
418+ send file generated by temp module, for example). [Optional]
396419 reply_to_message_id:
397420 If the message is a reply, ID of the original message. [Optional]
398421 reply_markup:
@@ -409,13 +432,17 @@ def sendSticker(self,
409432 data = {'chat_id' : chat_id ,
410433 'sticker' : sticker }
411434
435+ if filename :
436+ data ['filename' ] = filename
437+
412438 return url , data
413439
414440 @log
415441 @message
416442 def sendVideo (self ,
417443 chat_id ,
418444 video ,
445+ filename = None ,
419446 duration = None ,
420447 caption = None ,
421448 ** kwargs ):
@@ -429,6 +456,9 @@ def sendVideo(self,
429456 Video to send. You can either pass a file_id as String to resend a
430457 video that is already on the Telegram servers, or upload a new
431458 video file using multipart/form-data.
459+ filename:
460+ File name that shows in telegram message (it is usefull when you
461+ send file generated by temp module, for example). [Optional]
432462 duration:
433463 Duration of sent video in seconds. [Optional]
434464 caption:
@@ -450,6 +480,8 @@ def sendVideo(self,
450480 data = {'chat_id' : chat_id ,
451481 'video' : video }
452482
483+ if filename :
484+ data ['filename' ] = filename
453485 if duration :
454486 data ['duration' ] = duration
455487 if caption :
@@ -462,6 +494,7 @@ def sendVideo(self,
462494 def sendVoice (self ,
463495 chat_id ,
464496 voice ,
497+ filename = None ,
465498 duration = None ,
466499 ** kwargs ):
467500 """Use this method to send audio files, if you want Telegram clients to
@@ -478,6 +511,9 @@ def sendVoice(self,
478511 Audio file to send. You can either pass a file_id as String to
479512 resend an audio that is already on the Telegram servers, or upload
480513 a new audio file using multipart/form-data.
514+ filename:
515+ File name that shows in telegram message (it is usefull when you
516+ send file generated by temp module, for example). [Optional]
481517 duration:
482518 Duration of sent audio in seconds. [Optional]
483519 reply_to_message_id:
@@ -496,6 +532,8 @@ def sendVoice(self,
496532 data = {'chat_id' : chat_id ,
497533 'voice' : voice }
498534
535+ if filename :
536+ data ['filename' ] = filename
499537 if duration :
500538 data ['duration' ] = duration
501539
0 commit comments