
    N[ig                     h    d dl m Z  d dlmZmZmZ d dlZd dlmZmZ d dlmZ d dlm	Z	  G d d      Z
y)	    )datetime)UnionListOptionalN)rawenums)types)utilsc                   x    e Zd Z	 	 	 	 	 	 	 	 ddddeeef   dededed   d	ed
   dedede	deded   ded   fdZ
y)SendCachedMediaNselfzpyrogram.Clientchat_idfile_idcaption
parse_modezenums.ParseModecaption_entitiesztypes.MessageEntitydisable_notificationreply_to_message_idschedule_dateprotect_contentreply_markup)ztypes.InlineKeyboardMarkupztypes.ReplyKeyboardMarkupztypes.ReplyKeyboardRemoveztypes.ForceReplyreturnztypes.Messagec                   K   | j                  t        j                  j                  j                  d| j                  |       d{   t        j                  |      |xs d|| j                         t        j                  |      |	|
r|
j                  |        d{   nddt        j                  | |||       d{          d{   }|j                  D ]  }t        |t        j                  j                  t        j                  j                   t        j                  j"                  f      s[t        j$                  j'                  | |j(                  |j*                  D ci c]  }|j,                  | c}|j.                  D ci c]  }|j,                  | c}t        t        j                  j"                               d{   c S  y7 7 B7 "7 c c}w c c}w 7 w)a*
  Send any media stored on the Telegram servers using a file_id.

        This convenience method works with any valid file_id only.
        It does the same as calling the relevant method for sending media using a file_id, thus saving you from the
        hassle of using the correct method for the media the file_id is pointing to.

        .. 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).

            file_id (``str``):
                Media to send.
                Pass a file_id as string to send a media that exists on the Telegram servers.

            caption (``str``, *optional*):
                Media 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*.

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

            reply_to_message_id (``int``, *optional*):
                If the message is a reply, ID of the original message.

            schedule_date (:py:obj:`~datetime.datetime`, *optional*):
                Date when the message will be automatically sent.
            
            protect_content (``bool``, *optional*):
                Protects the contents of the sent message from forwarding and saving.

            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.

        Returns:
            :obj:`~pyrogram.types.Message`: On success, the sent media message is returned.

        Example:
            .. code-block:: python

                await app.send_cached_media("me", file_id)
        N)peermediasilentreply_to_msg_id	random_idr   
noforwardsr   )is_scheduled )invoker   	functionsmessages	SendMediaresolve_peerr
   get_input_media_from_file_idrnd_iddatetime_to_timestampwriteparse_text_entitiesupdates
isinstancer	   UpdateNewMessageUpdateNewChannelMessageUpdateNewScheduledMessageMessage_parsemessageusersidchats)r   r   r   r   r   r   r   r   r   r   r   ris                ^/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/messages/send_cached_media.pysend_cached_mediaz!SendCachedMedia.send_cached_media   s    P ++MM"",, 
,,W5588A+3t 3++-#99-H*?K<#5#5d#;;;QU
 11$M]^^

 
  		A!cii88!ii??!iiAAC D #]]11!))&'gg.QTT1W.&'gg.QTT1W.!+Asyy/R/R!S	 2   			 6 <^
( /.sz   AG5GAG5G "G5G#G5G&A*G5;3G5.G)G5G.&.G5G3	G5 G5#G5&G5)G5) NNNNNNN)__name__
__module____qualname__r   intstrr   r   boolr   r:   r!       r9   r   r      s    
 268<%)#'"& $ !__sCx_ _ 	_
 ./_ 45_ #_ !_  _ _ 
_" 
/	"#_rB   r   )r   typingr   r   r   pyrogramr   r   r	   r
   r   r!   rB   r9   <module>rE      s(   &  ( (    ` `rB   