L idZddlZddlmZddlmZmZmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZmZddl m!Z!ddl"m#Z#ddl$m%Z%ddl&m'Z'm(Z(m)Z)m*Z*ddl+m,Z,ee eeeefZ-GddeZ.GddeZ/Gdde/Z0Gdde/Z1Gdde.Z2Gdd e.Z3Gd!d"e.Z4Gd#d$e.Z5Gd%d&e.Z6y)'z+Base class for Telegram InputMedia Objects.N)Sequence)FinalOptionalUnion) constants) Animation)Audio)Document) InputFile) PhotoSize)Video) MessageEntity)TelegramObject)enum)parse_sequence_arg to_timedelta)get_timedelta_value) DEFAULT_NONEparse_file_input) FileInputJSONDictODVInput TimePeriod)InputMediaTypeceZdZdZdZddefdddedeeefde ede e e d e ed e e f fd Zed e ed e eeeffdZxZS) InputMediaa Base class for Telegram InputMedia Objects. .. versionchanged:: 20.0 Added arguments and attributes :attr:`type`, :attr:`media`, :attr:`caption`, :attr:`caption_entities`, :paramref:`parse_mode`. .. seealso:: :wiki:`Working with Files and Media ` Args: media_type (:obj:`str`): Type of media that the instance represents. media (:obj:`str` | :class:`~telegram.InputFile`): File to send. |fileinputnopath| caption (:obj:`str`, optional): Caption of the media to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities| .. versionchanged:: 20.0 |sequenceclassargs| parse_mode (:obj:`str`, optional): |parse_mode| Attributes: type (:obj:`str`): Type of the input media. media (:obj:`str` | :class:`telegram.InputFile`): Media to send. caption (:obj:`str`): Optional. Caption of the media to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`): Optional. |parse_mode| caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr| .. versionchanged:: 20.0 * |tupleclassattrs| * |alwaystuple| )captioncaption_entitiesmedia parse_modetypeN api_kwargs media_typer rrr!r$ct||tjtj |||_||_||_t||_ ||_ |jyNr#) super__init__r get_memberrrr"r rrrr!_freeze)selfr%r rrr!r$ __class__s `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_files/inputmedia.pyr)zInputMedia.__init__Ws[ J/)A)A:zZ ,1 &- ;MN^;_)3  thumbnailreturnc&|t|ddS|S)NTattach local_moder)r0s r._parse_thumbnail_inputz!InputMedia._parse_thumbnail_inputjs' $ Yt E  r/)__name__ __module__ __qualname____doc__ __slots__rstrrr rrrrrr) staticmethodrr6 __classcell__r-s@r.rr-s%NOI "&>B$0 *.S)^$#  #8M#:;  SM X&& (9*= (5QTV_Q_K`Ba  r/rceZdZUdZej j Zeee d< ej jZ eee d< dZ dddede ee fd eeffd ZxZS) InputPaidMediaah Base class for Telegram InputPaidMedia Objects. Currently, it can be one of: * :class:`telegram.InputPaidMediaPhoto` * :class:`telegram.InputPaidMediaVideo` .. seealso:: :wiki:`Working with Files and Media ` .. versionadded:: 21.4 Args: type (:obj:`str`): Type of media that the instance represents. media (:obj:`str` | :class:`~telegram.InputFile`): File to send. |fileinputnopath| Attributes: type (:obj:`str`): Type of the input media. media (:obj:`str` | :class:`telegram.InputFile`): Media to send. PHOTOVIDEO)r r"Nr#r"r r$ct||tjtj |||_||_|jyr') r(r)rr*rInputPaidMediaTyper"r r+)r,r"r r$r-s r.r)zInputPaidMedia.__init__s? J/)E)EtTR ,1  r/)r7r8r9r:rrErBrr<__annotations__rCr;rr rrr)r>r?s@r.rArAus("44::E5::>!44::E5::>!I*.  S)^$  X&  r/rAcFeZdZdZdZdddeeefdee ffdZ xZ S)InputPaidMediaPhotoaThe paid media to send is a photo. .. seealso:: :wiki:`Working with Files and Media ` .. versionadded:: 21.4 Args: media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` | :class:`pathlib.Path` | :class:`telegram.PhotoSize`): File to send. |fileinputnopath| Lastly you can pass an existing :class:`telegram.PhotoSize` object to send. Attributes: type (:obj:`str`): Type of the media, always :tg-const:`telegram.constants.InputPaidMediaType.PHOTO`. media (:obj:`str` | :class:`telegram.InputFile`): Photo to send. Nr#r r$ct|tdd}t| tj |||j yNTr3)r"r r$)rr r(r)rArBr+)r,r r$r-s r.r)zInputPaidMediaPhoto.__init__s8 ! $4P n22%JW r/) r7r8r9r:r;rrr rrr)r>r?s@r.rHrHs?"I *. Y )*X& r/rHceZdZdZdZ ddddeeefdeedee dee d ee d ee d eed ee d ee ffdZ edeee ej ffdZxZS)InputPaidMediaVideoa The paid media to send is a video. .. seealso:: :wiki:`Working with Files and Media ` .. versionadded:: 21.4 Note: * When using a :class:`telegram.Video` for the :attr:`media` attribute, it will take the width, height and duration from that video, unless otherwise specified with the optional arguments. * :paramref:`thumbnail` will be ignored for small video files, for which Telegram can easily generate thumbnails. However, this behaviour is undocumented and might be changed by Telegram. Args: media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` | :class:`pathlib.Path` | :class:`telegram.Video`): File to send. |fileinputnopath| Lastly you can pass an existing :class:`telegram.Video` object to send. thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`, optional): |thumbdocstringnopath| cover (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`, optional): Cover for the video in the message. |fileinputnopath| .. versionchanged:: 21.11 start_timestamp (:obj:`int`, optional): Start timestamp for the video in the message .. versionchanged:: 21.11 width (:obj:`int`, optional): Video width. height (:obj:`int`, optional): Video height. duration (:obj:`int` | :class:`datetime.timedelta`, optional): Video duration in seconds. .. versionchanged:: v22.2 |time-period-input| supports_streaming (:obj:`bool`, optional): Pass :obj:`True`, if the uploaded video is suitable for streaming. Attributes: type (:obj:`str`): Type of the media, always :tg-const:`telegram.constants.InputPaidMediaType.VIDEO`. media (:obj:`str` | :class:`telegram.InputFile`): Video to send. thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase| cover (:class:`telegram.InputFile`): Optional. Cover for the video in the message. |fileinputnopath| .. versionchanged:: 21.11 start_timestamp (:obj:`int`): Optional. Start timestamp for the video in the message .. versionchanged:: 21.11 width (:obj:`int`): Optional. Video width. height (:obj:`int`): Optional. Video height. duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Video duration in seconds. .. deprecated:: v22.2 |time-period-int-deprecated| supports_streaming (:obj:`bool`): Optional. :obj:`True`, if the uploaded video is suitable for streaming. ) _durationcoverheightstart_timestampsupports_streamingr0widthNr#r r0rSrPdurationrRrOrQr$c t|tr=||n |j}||n |j}||n |j}|j }nt |dd}t |!tj|| |j5tj||_||_||_t||_||_|rt |ddnd|_||_dddy#1swYyxYwrK) isinstancer rSrPrNfile_idrr(r)rArC _unfrozenrr6r0rrRrOrQ) r,r r0rSrPrTrRrOrQr$r-s r.r)zInputPaidMediaVideo.__init__s eU #".EEKKE%1Vu||F#+#7xU__HMME%U4DIE n22%JW ^^  B>H>_>_?DN).DJ)/DK6B86LDN6HD #IN tETX J3BD  B B Bs AC44C=r1c0t|jdSNrT) attributerrNr,s r.rTzInputPaidMediaVideo.duration)"4>>ZHHr/)NNNNNNN)r7r8r9r:r;rrr rintrboolrr)propertydtm timedeltarTr>r?s@r.rMrMs9vI*.# $)--1%))-#B*.#BY%&#BI&#B} #B  #B :& #B%TN#B "#B"##BX&#BJI(5cmm);#<=IIr/rMceZdZdZdZdeddddddddf dddeeefde e de e de e d e e d e e d e eed e e d e ede ede ede effdZede ee ej*ffdZxZS)InputMediaAnimationaORepresents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. Note: When using a :class:`telegram.Animation` for the :attr:`media` attribute, it will take the width, height and duration from that animation, unless otherwise specified with the optional arguments. .. seealso:: :wiki:`Working with Files and Media ` .. versionchanged:: 20.5 |removed_thumb_note| Args: media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` | :class:`pathlib.Path` | :class:`telegram.Animation`): File to send. |fileinputnopath| Lastly you can pass an existing :class:`telegram.Animation` object to send. .. versionchanged:: 13.2 Accept :obj:`bytes` as input. filename (:obj:`str`, optional): Custom file name for the animation, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the :obj:`tempfile` module. .. versionadded:: 13.1 caption (:obj:`str`, optional): Caption of the animation to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`, optional): |parse_mode| caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities| .. versionchanged:: 20.0 |sequenceclassargs| width (:obj:`int`, optional): Animation width. height (:obj:`int`, optional): Animation height. duration (:obj:`int` | :class:`datetime.timedelta`, optional): Animation duration in seconds. .. versionchanged:: v22.2 |time-period-input| has_spoiler (:obj:`bool`, optional): Pass :obj:`True`, if the animation needs to be covered with a spoiler animation. .. versionadded:: 20.0 thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`, optional): |thumbdocstringnopath| .. versionadded:: 20.2 show_caption_above_media (:obj:`bool`, optional): Pass |show_cap_above_med| .. versionadded:: 21.3 Attributes: type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.ANIMATION`. media (:obj:`str` | :class:`telegram.InputFile`): Animation to send. caption (:obj:`str`): Optional. Caption of the animation to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`): Optional. The parse mode to use for text formatting. caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr| .. versionchanged:: 20.0 * |tupleclassattrs| * |alwaystuple| width (:obj:`int`): Optional. Animation width. height (:obj:`int`): Optional. Animation height. duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Animation duration in seconds. .. deprecated:: v22.2 |time-period-int-deprecated| has_spoiler (:obj:`bool`): Optional. :obj:`True`, if the animation is covered with a spoiler animation. .. versionadded:: 20.0 thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase| .. versionadded:: 20.2 show_caption_above_media (:obj:`bool`): Optional. |show_cap_above_med| .. versionadded:: 21.3 )rN has_spoilerrPshow_caption_above_mediar0rSNr#r rr!rSrPrTrfilenamerfr0rgr$c t|tr=| |jn|}| |jn|}||n |j}|j }nt ||dd}t |!tj||||| |j5|j| |_ ||_||_t||_| |_| |_dddy#1swYyxYwNTrhr4r5r#)rVrrSrPrNrWrr(r)r ANIMATIONrXr6r0rrfrg)r,r rr!rSrPrTrrhrfr0rgr$r-s r.r)zInputMediaAnimation.__init__s eY '#(=EKKeE%+^U\\F#+#7xU__HMME%UXdW[\E   $ $    !  ^^  U>B>Y>Y?DN).DJ)/DK6B86LDN/:D r?s@r.rere.s5RhI"&$0# $)->B"&&*)-37*U*.*UY )**U#*USM *U } *U  *U:&*U#8M#:;*U3-*Ud^*UI&*U#+4.*UX&*UXI(5cmm);#<=IIr/receZdZdZdZdeddddfdddeeefde e de e de e e d e e d e ed e ed e effd ZxZS)InputMediaPhotoa9 Represents a photo to be sent. .. seealso:: :wiki:`Working with Files and Media ` Args: media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` | :class:`pathlib.Path` | :class:`telegram.PhotoSize`): File to send. |fileinputnopath| Lastly you can pass an existing :class:`telegram.PhotoSize` object to send. .. versionchanged:: 13.2 Accept :obj:`bytes` as input. filename (:obj:`str`, optional): Custom file name for the photo, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the :obj:`tempfile` module. .. versionadded:: 13.1 caption (:obj:`str`, optional ): Caption of the photo to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`, optional): |parse_mode| caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities| .. versionchanged:: 20.0 |sequenceclassargs| has_spoiler (:obj:`bool`, optional): Pass :obj:`True`, if the photo needs to be covered with a spoiler animation. .. versionadded:: 20.0 show_caption_above_media (:obj:`bool`, optional): Pass |show_cap_above_med| .. versionadded:: 21.3 Attributes: type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.PHOTO`. media (:obj:`str` | :class:`telegram.InputFile`): Photo to send. caption (:obj:`str`): Optional. Caption of the photo to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`): Optional. |parse_mode| caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr| .. versionchanged:: 20.0 * |tupleclassattrs| * |alwaystuple| has_spoiler (:obj:`bool`): Optional. :obj:`True`, if the photo is covered with a spoiler animation. .. versionadded:: 20.0 show_caption_above_media (:obj:`bool`): Optional. |show_cap_above_med| .. versionadded:: 21.3 )rfrgNr#r rr!rrhrfrgr$ct|t|dd}t | tj ||||||j 5||_||_dddy#1swYyxYwrj) rr r(r)rrBrXrfrg) r,r rr!rrhrfrgr$r-s r.r)zInputMediaPhoto.__init__sw! HT^bc      !  ^^  U/:D r?s@r.roros4lI"&$0>B"&&*37U*.UY )*U#USM U #8M#:; U 3- Ud^U#+4.UX&UUr/roc!$eZdZdZdZdddddedddddddf dddeeefde e de e de e d e e d e e d ee d e eed e e de e de ede e de ede e de effdZede ee ej*ffdZxZS)InputMediaVideoaRepresents a video to be sent. .. seealso:: :wiki:`Working with Files and Media ` Note: * When using a :class:`telegram.Video` for the :attr:`media` attribute, it will take the width, height and duration from that video, unless otherwise specified with the optional arguments. * :paramref:`thumbnail` will be ignored for small video files, for which Telegram can easily generate thumbnails. However, this behaviour is undocumented and might be changed by Telegram. .. versionchanged:: 20.5 |removed_thumb_note| Args: media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` | :class:`pathlib.Path` | :class:`telegram.Video`): File to send. |fileinputnopath| Lastly you can pass an existing :class:`telegram.Video` object to send. .. versionchanged:: 13.2 Accept :obj:`bytes` as input. filename (:obj:`str`, optional): Custom file name for the video, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the :obj:`tempfile` module. .. versionadded:: 13.1 caption (:obj:`str`, optional): Caption of the video to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`, optional): |parse_mode| caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities| .. versionchanged:: 20.0 |sequenceclassargs| width (:obj:`int`, optional): Video width. height (:obj:`int`, optional): Video height. duration (:obj:`int` | :class:`datetime.timedelta`, optional): Video duration in seconds. .. versionchanged:: v22.2 |time-period-input| supports_streaming (:obj:`bool`, optional): Pass :obj:`True`, if the uploaded video is suitable for streaming. has_spoiler (:obj:`bool`, optional): Pass :obj:`True`, if the video needs to be covered with a spoiler animation. .. versionadded:: 20.0 thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`, optional): |thumbdocstringnopath| .. versionadded:: 20.2 cover (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`, optional): Cover for the video in the message. |fileinputnopath| .. versionchanged:: 21.11 start_timestamp (:obj:`int`, optional): Start timestamp for the video in the message .. versionchanged:: 21.11 show_caption_above_media (:obj:`bool`, optional): Pass |show_cap_above_med| .. versionadded:: 21.3 Attributes: type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.VIDEO`. media (:obj:`str` | :class:`telegram.InputFile`): Video file to send. caption (:obj:`str`): Optional. Caption of the video to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`): Optional. |parse_mode| caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr| .. versionchanged:: 20.0 * |tupleclassattrs| * |alwaystuple| width (:obj:`int`): Optional. Video width. height (:obj:`int`): Optional. Video height. duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Video duration in seconds. .. deprecated:: v22.2 |time-period-int-deprecated| supports_streaming (:obj:`bool`): Optional. :obj:`True`, if the uploaded video is suitable for streaming. has_spoiler (:obj:`bool`): Optional. :obj:`True`, if the video is covered with a spoiler animation. .. versionadded:: 20.0 thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase| .. versionadded:: 20.2 show_caption_above_media (:obj:`bool`): Optional. |show_cap_above_med| .. versionadded:: 21.3 cover (:class:`telegram.InputFile`): Optional. Cover for the video in the message. |fileinputnopath| .. versionchanged:: 21.11 start_timestamp (:obj:`int`): Optional. Start timestamp for the video in the message .. versionchanged:: 21.11 ) rNrOrfrPrgrQrRr0rSNr#r rrSrPrTrRr!rrhrfr0rgrOrQr$ct|tr=||n |j}||n |j}||n |j}|j }nt || dd}t|!tj||||||j5||_||_t||_|j| |_||_| |_| |_| rt | ddnd|_||_dddy#1swYyxYw)NTrkr#r3)rVr rSrPrNrWrr(r)rrCrXrr6r0rRrfrgrOrQ)r,r rrSrPrTrRr!rrhrfr0rgrOrQr$r-s r.r)zInputMediaVideo.__init__s& eU #".EEKKE%1Vu||F#+#7xU__HMME%UXdW[\E      !  ^^  B(-DJ)/DK6B86LDN>B>Y>Y?DN7ID #/:D r?s@r.rrrrsleN I"&# $)--1$0>B"&&*)-37%))-2B"*.#2BY%&2B#2B} 2B  2B :& 2B%TN2BSM2B#8M#:;2B3-2Bd^2BI&2B#+4.2B "2B"#2B"XBhI(5cmm);#<=IIr/rrceZdZdZdZdeddddddfdddeeefde e de e de e d e e d e e d e e ed e e d e ede effdZede eeej(ffdZxZS)InputMediaAudioa Represents an audio file to be treated as music to be sent. .. seealso:: :wiki:`Working with Files and Media ` Note: When using a :class:`telegram.Audio` for the :attr:`media` attribute, it will take the duration, performer and title from that video, unless otherwise specified with the optional arguments. .. versionchanged:: 20.5 |removed_thumb_note| Args: media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` | :class:`pathlib.Path` | :class:`telegram.Audio`): File to send. |fileinputnopath| Lastly you can pass an existing :class:`telegram.Audio` object to send. .. versionchanged:: 13.2 Accept :obj:`bytes` as input. filename (:obj:`str`, optional): Custom file name for the audio, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the :obj:`tempfile` module. .. versionadded:: 13.1 caption (:obj:`str`, optional): Caption of the audio to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`, optional): |parse_mode| caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities| .. versionchanged:: 20.0 |sequenceclassargs| duration (:obj:`int` | :class:`datetime.timedelta`, optional): Duration of the audio in seconds as defined by the sender. .. versionchanged:: v22.2 |time-period-input| performer (:obj:`str`, optional): Performer of the audio as defined by the sender or by audio tags. title (:obj:`str`, optional): Title of the audio as defined by the sender or by audio tags. thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`, optional): |thumbdocstringnopath| .. versionadded:: 20.2 Attributes: type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.AUDIO`. media (:obj:`str` | :class:`telegram.InputFile`): Audio file to send. caption (:obj:`str`): Optional. Caption of the audio to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`): Optional. |parse_mode| caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr| .. versionchanged:: 20.0 * |tupleclassattrs| * |alwaystuple| duration (:obj:`int` | :class:`datetime.timedelta`): Optional. Duration of the audio in seconds. .. deprecated:: v22.2 |time-period-int-deprecated| performer (:obj:`str`): Optional. Performer of the audio as defined by the sender or by audio tags. title (:obj:`str`): Optional. Title of the audio as defined by the sender or by audio tags. thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase| .. versionadded:: 20.2 )rN performerr0titleNr#r rr!rTrwrxrrhr0r$c t|tr=||n |j}| |jn|}| |jn|}|j }nt ||dd}t |!tj||||| |j5|j| |_ t||_||_||_dddy#1swYyxYwrj)rVr rNrwrxrWrr(r)rAUDIOrXr6r0r) r,r rr!rTrwrxrrhr0r$r-s r.r)zInputMediaAudio.__init__s eU ##+#7xU__H+4+<)I#(=EKKeEMME%UXdW[\E      !  ^^  6>B>Y>Y?DN7C86LDN(-DJ,5DN  6 6 6s 5CCr1c0t|jdSrZr\r]s r.rTzInputMediaAudio.duration7r^r/)r7r8r9r:r;rrrr rr<rrrrrr)rar_rbrcrTr>r?s@r.rvrvsGRAI "&$0)-#'#>B"&)-&6*.&6Y%&&6#&6SM &6 :& &6 C= &6}&6#8M#:;&63-&6I&&6X&&6PI(5cmm);#<=IIr/rvceZdZdZdZdeddddfdddeeefde e de e de e d e e ed e e d e ed e effd ZxZS)InputMediaDocumentaq Represents a general file to be sent. .. seealso:: :wiki:`Working with Files and Media ` .. versionchanged:: 20.5 |removed_thumb_note| Args: media (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` | :class:`pathlib.Path` | :class:`telegram.Document`): File to send. |fileinputnopath| Lastly you can pass an existing :class:`telegram.Document` object to send. .. versionchanged:: 13.2 Accept :obj:`bytes` as input. filename (:obj:`str`, optional): Custom file name for the document, when uploading a new file. Convenience parameter, useful e.g. when sending files generated by the :obj:`tempfile` module. .. versionadded:: 13.1 caption (:obj:`str`, optional): Caption of the document to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`, optional): |parse_mode| caption_entities (Sequence[:class:`telegram.MessageEntity`], optional): |caption_entities| .. versionchanged:: 20.0 |sequenceclassargs| disable_content_type_detection (:obj:`bool`, optional): Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always :obj:`True`, if the document is sent as part of an album. thumbnail (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`, optional): |thumbdocstringnopath| .. versionadded:: 20.2 Attributes: type (:obj:`str`): :tg-const:`telegram.constants.InputMediaType.DOCUMENT`. media (:obj:`str` | :class:`telegram.InputFile`): File to send. caption (:obj:`str`): Optional. Caption of the document to be sent, 0-:tg-const:`telegram.constants.MessageLimit.CAPTION_LENGTH` characters after entities parsing. parse_mode (:obj:`str`): Optional. |parse_mode| caption_entities (tuple[:class:`telegram.MessageEntity`]): Optional. |captionentitiesattr| .. versionchanged:: 20.0 * |tupleclassattrs| * |alwaystuple| disable_content_type_detection (:obj:`bool`): Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always :obj:`True`, if the document is sent as part of an album. thumbnail (:class:`telegram.InputFile`): Optional. |thumbdocstringbase| .. versionadded:: 20.2 )disable_content_type_detectionr0Nr#r rr!r~rrhr0r$ct|t|dd}t | tj ||||||j 5|j||_||_ dddy#1swYyxYwrj) rr r(r)rDOCUMENTrXr6r0r~) r,r rr!r~rrhr0r$r-s r.r)zInputMediaDocument.__init__xs!8D]ab   # #    !  ^^  a>B>Y>Y?DNCaD /  a a as A00A9)r7r8r9r:r;rrrr rr<rr`rrrr)r>r?s@r.r}r}<s7r@I "&$09=>B"&)-a*.aY()a#aSM a )1 a #8M#:; a3-aI&aX&aar/r})7r:datetimerbcollections.abcrtypingrrrtelegramrtelegram._files.animationrtelegram._files.audior telegram._files.documentr telegram._files.inputfiler telegram._files.photosizer telegram._files.videor telegram._messageentityrtelegram._telegramobjectrtelegram._utilsrtelegram._utils.argumentparsingrrtelegram._utils.datetimertelegram._utils.defaultvaluertelegram._utils.filesrtelegram._utils.typesrrrrtelegram.constantsr MediaTyperrArHrMrerorrrvr}rIr/r.rs&2$))/'-//'13 L852KK- )UHi> ? E E P'^'T.>mI.mI`LI*LI^VUjVUrjIjjIZvIjvIrXaXar/