
    i8                         S SK r S SKrS SKrS SKJr  S SKJrJrJrJrJ	r	  S SK
r
S SK
JrJrJrJr  S SKJr  S SKJr  \ R&                  " \5      r " S S5      rg)	    N)datetime)BinaryIOCallableListOptionalUnion)enumsrawtypesutils)FilePartMissing)FileTypec            B          \ rS rSr                            S,SSS\\\4   S\\\4   S\S	\S
   S\	S   S\
S\S\
S\S\S\S\
SSS\S\S\
S\
S\S\
S\SSS\S    S!\S"\S#\S$\\\4   S%\S&\S'\	S   S(\S)\S*   4@S+ jjrSrg)-	SendPhoto    N selfzpyrogram.Clientchat_idphotocaption
parse_modezenums.ParseModecaption_entitiesztypes.MessageEntityhas_spoilerttl_secondsdisable_notificationmessage_thread_iddirect_messages_topic_id	effect_idshow_caption_above_mediareply_parametersztypes.ReplyParametersschedule_daterepeat_periodprotect_content	view_oncebusiness_connection_idallow_paid_broadcastpaid_message_star_countsuggested_post_parametersztypes.SuggestedPostParametersreply_markup)ztypes.InlineKeyboardMarkupztypes.ReplyKeyboardMarkupztypes.ReplyKeyboardRemoveztypes.ForceReplyprogressprogress_argsreply_to_message_idreply_to_chat_idreply_to_story_id
quote_textquote_entitiesquote_offsetreturnztypes.Messagec                 X  #    [        USLUSLUSLUSLUSLUSL45      (       a  Ub  [        R                  S5        Ub  [        R                  S5        Ub  [        R                  S5        Ub  [        R                  S5        Ub  [        R                  S5        Ub  [        R                  S5        [        R                  " UUUUUUUS9nSn [        U[        5      (       a  [        R                  R                  U5      (       aB  U R                  UUUS	9I Sh  vN n[        R                  R                  UU(       a  S
OUUS9n O[        R                  " SU5      (       a)  [        R                  R                  UU(       a  S
OUUS9n Op[         R"                  " U[$        R&                  U(       a  S
OUUS9n OAU R                  UUUS	9I Sh  vN n[        R                  R                  UU(       a  S
OUUS9n   U R)                  U5      I Sh  vN n!U R+                  [        R,                  R.                  R0                  " SU!U U=(       d    SU[         R2                  " U UU	U
5      I Sh  vN U R5                  5       [         R6                  " U5      UUUUU(       a  UR9                  5       OSU(       a  UR9                  U 5      I Sh  vN OSUS.[         R:                  " XXE5      I Sh  vN D6US9I Sh  vN n"[         R<                  " U U"S9I Sh  vN n#U#(       a  U#S   $ S$  GN GNc GN# N Nj NI N> N#! [>         a8  n$U R                  UUR@                  U$RB                  S9I Sh  vN     Sn$A$OSn$A$ff = fGM  ! [D        RF                   a     gf = f7f)a  Send photos.

.. include:: /_includes/usable-by/users-bots.rst

Parameters:
    chat_id (``int`` | ``str``):
        Unique identifier (int) or username (str) of the target chat.
        For your personal cloud (Saved Messages) you can simply use "me" or "self".
        For a contact that exists in your Telegram address book you can use his phone number (str).

    photo (``str`` | ``BinaryIO``):
        Photo to send.
        Pass a file_id as string to send a photo that exists on the Telegram servers,
        pass an HTTP URL as a string for Telegram to get a photo from the Internet,
        pass a file path as string to upload a new photo that exists on your local machine, or
        pass a binary file-like object with its attribute ".name" set for in-memory uploads.

    caption (``str``, *optional*):
        Photo caption, 0-1024 characters.

    parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
        By default, texts are parsed using both Markdown and HTML styles.
        You can combine both syntaxes together.

    caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
        List of special entities that appear in the caption, which can be specified instead of *parse_mode*.

    has_spoiler (``bool``, *optional*):
        Pass True if the photo needs to be covered with a spoiler animation.

    ttl_seconds (``int``, *optional*):
        Self-Destruct Timer.
        If you set a timer, the photo will self-destruct in *ttl_seconds*
        seconds after it was viewed.

    disable_notification (``bool``, *optional*):
        Sends the message silently.
        Users will receive a notification with no sound.

    message_thread_id (``int``, *optional*):
        Unique identifier for the target message thread (topic) of the forum.
        For forums only.

    direct_messages_topic_id (``int``, *optional*):
        Unique identifier of the topic in a channel direct messages chat administered by the current user.
        For directs only only.

    effect_id (``int``, *optional*):
        Unique identifier of the message effect.
        For private chats only.

    show_caption_above_media (``bool``, *optional*):
        Pass True, if the caption must be shown above the message media.

    reply_parameters (:obj:`~pyrogram.types.ReplyParameters`, *optional*):
        Describes reply parameters for the message that is being sent.

    schedule_date (:py:obj:`~datetime.datetime`, *optional*):
        Date when the message will be automatically sent.

    repeat_period (``int``, *optional*):
        Period after which the message will be sent again in seconds.

    protect_content (``bool``, *optional*):
        Protects the contents of the sent message from forwarding and saving.

    view_once (``bool``, *optional*):
        Self-Destruct Timer.
        If True, the photo will self-destruct after it was viewed.

    business_connection_id (``str``, *optional*):
        Unique identifier of the business connection on behalf of which the message will be sent.

    allow_paid_broadcast (``bool``, *optional*):
        If True, you will be allowed to send up to 1000 messages per second.
        Ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message.
        The relevant Stars will be withdrawn from the bot's balance.
        For bots only.

    paid_message_star_count (``int``, *optional*):
        The number of Telegram Stars the user agreed to pay to send the messages.

    suggested_post_parameters (:obj:`~pyrogram.types.SuggestedPostParameters`, *optional*):
        Information about the suggested post.

    reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*):
        Additional interface options. An object for an inline keyboard, custom reply keyboard,
        instructions to remove reply keyboard or to force a reply from the user.

    progress (``Callable``, *optional*):
        Pass a callback function to view the file transmission progress.
        The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
        detailed description) and will be called back each time a new file chunk has been successfully
        transmitted.

    progress_args (``tuple``, *optional*):
        Extra custom arguments for the progress callback function.
        You can pass anything you need to be available in the progress callback scope; for example, a Message
        object or a Client instance in order to edit the message with the updated progress status.

Other Parameters:
    current (``int``):
        The amount of bytes transmitted so far.

    total (``int``):
        The total size of the file.

    *args (``tuple``, *optional*):
        Extra custom arguments as defined in the ``progress_args`` parameter.
        You can either keep ``*args`` or add every single extra argument in your function signature.

Returns:
    :obj:`~pyrogram.types.Message` | ``None``: On success, the sent photo message is returned, otherwise, in
    case the upload is deliberately stopped with :meth:`~pyrogram.Client.stop_transmission`, None is returned.

Example:
    .. code-block:: python

        # Send photo by uploading from local file
        await app.send_photo("me", "photo.jpg")

        # Send photo by uploading from URL
        await app.send_photo("me", "https://example.com/example.jpg")

        # Add caption to a photo
        await app.send_photo("me", "photo.jpg", caption="Caption")

        # Send self-destructing photo
        await app.send_photo("me", "photo.jpg", ttl_seconds=10)

        # Send view-once photo
        await app.send_photo("me", "photo.jpg", view_once=True)
Nzj`reply_to_message_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zg`reply_to_chat_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zh`reply_to_story_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.za`quote_text` is deprecated and will be removed in future updates. Use `reply_parameters` instead.ze`quote_entities` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zc`quote_offset` is deprecated and will be removed in future updates. Use `reply_parameters` instead.)
message_idr   story_idquotequote_parse_moder0   quote_position)r*   r+   i)filer   spoilerz
^https?://)urlr   r:   )r   r   )peermediasilentinvert_mediareply_to	random_idr!   schedule_repeat_period
noforwardsallow_paid_floodskipallow_paid_starssuggested_postr)   effect)r%   )clientmessagesr   )file_id	file_partr   )$anylogwarningr   ReplyParameters
isinstancestrospathisfile	save_filer
   InputMediaUploadedPhotorematchInputMediaPhotoExternalr   get_input_media_from_file_idr   PHOTOresolve_peerinvoke	functionsrI   	SendMediaget_reply_tornd_iddatetime_to_timestampwriteparse_text_entitiesparse_messagesr   idvaluepyrogramStopTransmission)%r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r9   r=   r<   rrI   es%                                        Q/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/messages/send_photo.py
send_photoSendPhoto.send_photo!   s    X #4/ ,!-$&d*D(	
 	
 #. A  +} !,~ %w ){ 'y  %44.(* !+-+  <	%%%77>>%((!%Xe!ffDII==!5>MK + > E
 XXlE22II==!5>MK + > E ">>uhnns|bo  CN  \g  hE!^^EHTa^bb		991:' :   =!%!2!27!;;D"kk..88 !%"'#7#?4)A+0+=+= $ 0 1 8	, & '+kkm*/*E*Em*T3@'61E-DPi+D+J+J+LosKW|/A/A$/G)G)G]a#,'( %*$=$=dZ$jj), 0F/ *  A8 &+%9%9PQ%RRH*28A;<<o g c <& *Hj+8  S ' T..177.SSST9 D (( 		s   CN*AN L5 B5N L8-N M L;AM 6L>7AM M &"M 8M9M MM 
N "M#N 2N*3N 4N*5N 8N ;M >M  M M M N 
N
(N:M=;N N N

N N'$N*&N''N*) NNNNNNNNNNNNNNNNNNNNr   NNNNNN)__name__
__module____qualname____firstlineno__r   intrQ   r   r   r   boolr   r   tuplerm   __static_attributes__r       rl   r   r       s   
 268< %)!%(,)-48"&! $&*%)'+EI !!#',0!%6: K\\sCx\ S(]#\ 	\
 ./\ 45\ \ \ #\ \ #&\ \ #'\ 2\  \  !\" #\$ %\& !$'\( #)\* "%+\, $C-\. 
/\: ;\< =\@ !A\B  S/C\D E\F G\H 23I\J K\L 
/	"M\ \rx   r   )loggingrR   rW   r   typingr   r   r   r   r   rh   r	   r
   r   r   pyrogram.errorsr   pyrogram.file_idr   	getLoggerrp   rM   r   r   rx   rl   <module>r~      sD   &  	 	  < <  - - + %!] ]rx   