Ë
    :É„j«'  ã                   óX   — 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mZm	Z	  G d„ d«      Z
y)é    )Údatetime)ÚUnionÚListÚOptionalN)ÚtypesÚutilsÚrawÚenumsc            .       óê   — e Zd Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddddeeef   deeef   dedeee   ef   deee   ef   d	ed
edeeef   de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eded   f,d„Z
y)ÚCopyMediaGroupNÚselfzpyrogram.ClientÚchat_idÚfrom_chat_idÚ
message_idÚcaptionsÚhas_spoilersÚdisable_notificationÚmessage_thread_idÚsend_asÚreply_to_message_idÚreply_to_chat_idÚreply_to_story_idÚ
quote_textÚ
parse_modezenums.ParseModeÚquote_entitiesztypes.MessageEntityÚquote_offsetÚschedule_dateÚinvert_mediaÚprotect_contentÚallow_paid_broadcastÚmessage_effect_idÚreturnztypes.Messagec              ƒ   ó  K  — t        j                  | |||«      ƒ d{  –—† j                  «       \  }}| j                  ||«      ƒ d{  –—† }g }t	        |«      D �]É  \  }}|j
                  r|j
                  j                  }nt|j                  r|j                  j                  }nQ|j                  r|j                  j                  }n.|j                  r|j                  j                  }nt        d«      ‚t        j                  |t        |t        «      r|t        |«      k  r||   nt        |t        «      r|n|j                   ¬«      }|j#                  t%        j&                  j(                  d|| j+                  «       dœ| j,                  j/                  t        |t        «      r|t        |«      k  r
||   r||   nOt        |t0        «      r|dk(  r|n8|j2                  r+|j2                  dk7  rt        |t0        «      s|j2                  nd«      ƒ d{  –—† ¤Ž«       �ŒÌ t        j4                  | |	||
||||¬«      ƒ d{  –—† }| j7                  t$        j8                  j:                  j=                  | j?                  |«      ƒ d{  –—† ||xs d||r| j?                  |«      ƒ d{  –—† ndt        j@                  |«      ||||¬	«
      d
¬«      ƒ d{  –—† }t        jB                  | t$        j&                  j:                  jE                  tG        d„ |jH                  «      D �cg c]  }|jJ                  ‘Œ c}|jL                  |jN                  ¬«      «      ƒ d{  –—† S 7 �ŒM7 �Œ%7 �ŒW7 �Œ,7 Œç7 ŒÈ7 Œ�c c}w 7 Œ­w)aX  Copy a media group by providing one of the message ids.

        .. 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).
                You can also use chat public link in form of *t.me/<username>* (str).

            from_chat_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the source chat where the original media group was sent.
                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).
                You can also use chat public link in form of *t.me/<username>* (str).
                
            message_id (``int``):
                Message identifier in the chat specified in *from_chat_id*.

            captions (``str`` | List of ``str`` , *optional*):
                New caption for media, 0-1024 characters after entities parsing for each media.
                If not specified, the original caption is kept.
                Pass "" (empty string) to remove the caption.

                If a ``string`` is passed, it becomes a caption only for the first media.
                If a list of ``string`` passed, each element becomes caption for each media element.
                You can pass ``None`` in list to keep the original caption (see examples below).
                
            has_spoilers (``bool``, *optional*):
                Pass True if the photo needs to be covered with a spoiler animation.

            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 supergroups only.

            send_as (``int`` | ``str``):
                Unique identifier (int) or username (str) of the chat or channel to send the message as.
                You can use this to send the message on behalf of a chat or channel where you have appropriate permissions.

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

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

            reply_to_story_id (``int``, *optional*):
                If the message is a reply, ID of the target story.

            quote_text (``str``, *optional*):
                Text of the quote to be sent.

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

            quote_entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
                List of special entities that appear in quote text, which can be specified instead of *parse_mode*.

            quote_offset (``int``, *optional*):
                Offset for quote in original message.

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

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

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

            allow_paid_broadcast (``bool``, *optional*):
                Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only

            message_effect_id (``int`` ``64-bit``, *optional*):
                Unique identifier of the message effect to be added to the message; for private chats only.

        Returns:
            List of :obj:`~pyrogram.types.Message`: On success, a list of copied messages is returned.

        Example:
            .. code-block:: python

                # Copy a media group
                await app.copy_media_group(to_chat, from_chat, 123)

                await app.copy_media_group(to_chat, from_chat, 123, captions="single caption")

                await app.copy_media_group(to_chat, from_chat, 123,
                    captions=["caption 1", None, ""])
        Nz'Message with this type can't be copied.)Úfile_idÚhas_spoiler)ÚmediaÚ	random_idr   ÚNoneÚ )Úclientr   r   r   r   r   r   r   )
ÚpeerÚmulti_mediaÚsilentÚreply_tor   r   Ú
noforwardsr   Úallow_paid_floodskipÚeffecté<   )Úsleep_thresholdc                 ó°   — t        | t        j                  j                  t        j                  j                  t        j                  j
                  f«      S )N)Ú
isinstancer	   r   ÚUpdateNewMessageÚUpdateNewChannelMessageÚUpdateNewScheduledMessage)Úus    úa/var/www/html/GAP/venv/lib/python3.12/site-packages/pyrogram/methods/messages/copy_media_group.pyú<lambda>z1CopyMediaGroup.copy_media_group.<locals>.<lambda>ß   s:   € œj¨¬S¯Y©Y×-GÑ-GÜ-0¯Y©Y×-NÑ-NÜ-0¯Y©Y×-PÑ-Pð-Ró S€ ó    )ÚmessagesÚusersÚchats© )(r   Úparse_text_entitiesÚvaluesÚget_media_groupÚ	enumerateÚphotor$   ÚaudioÚdocumentÚvideoÚ
ValueErrorÚget_input_media_from_file_idr5   ÚlistÚlenÚboolÚhas_media_spoilerÚappendr	   r   ÚInputSingleMediaÚrnd_idÚparserÚparseÚstrÚcaptionÚget_reply_toÚinvokeÚ	functionsr=   ÚSendMultiMediaÚresolve_peerÚdatetime_to_timestampÚparse_messagesÚMessagesÚfilterÚupdatesÚmessager>   r?   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   Úmedia_groupr,   Úir`   r$   r&   r.   ÚrÚms                                 r:   Úcopy_media_groupzCopyMediaGroup.copy_media_group   s2  è ø€ ôl -2×,EÑ,EÀdÈJÐXbÐdrÓ,s×&s×%{Ñ%{Ó%}Ñ"ˆ
�Nà ×0Ñ0°¸zÓJ×JˆØˆä# KÓ0ó '	‰JˆAˆwØ�}Š}Ø!Ÿ-™-×/Ñ/‘Ø—’Ø!Ÿ-™-×/Ñ/‘Ø×!Ò!Ø!×*Ñ*×2Ñ2‘Ø—’Ø!Ÿ-™-×/Ñ/‘ä Ð!JÓKÐKä×6Ñ6Øô " ,´Ô5ØœC Ó-Ò-ð ! ’Oô
 & l´DÔ9ñ %à$×6Ñ6ôˆEð ×ÑÜ—	‘	×*Ñ*ð ØØ"Ÿk™k›mñð !ŸK™K×-Ñ-Ü'1°(¼DÔ'AÀaÌ#ÈhË-ÒFWÐ\dÐefÒ\g˜ šÜ$.¨x¼Ô$=À!ÀqÂ&™à#ŸOšOØ '§¡°6Ò 9Ü$.¨x¼Ô$=ð  Ÿšð $&ó÷ ñöð3'	ôR ×+Ñ+ØØ 3Ø/Ø-Ø/Ø!Ø)Ø%ô	
÷ 	
ˆð —+‘+Ü�M‰M×"Ñ"×1Ñ1Ø×,Ñ,¨WÓ5×5Ø'Ø+Ò3¨tØ!Ù<C˜d×/Ñ/°Ó8×8Ð8ÈÜ#×9Ñ9¸-ÓHØ*Ø)Ø%9Ø(ð 2ó ð ð ó 
÷ 
ˆô  ×)Ñ)ØÜ�I‰I×Ñ×'Ñ'Ü-3ñSð —I‘Ió	.ö ¨˜!Ÿ)›)ò ð —g‘gØ—g‘gð (ó 	ó
÷ 
ð 	
ðS 'tùàJùð@ùð	
ùð 6øð 9øð
úò&ð
úsœ   ‚NžM+Ÿ*NÁ	M.Á
GNÈM1È-NÉM4É	ANÊM7Ê NÊ0M9Ê1,NËM;ËANÌ.M=Í%NÍ&NÍ'NÍ.NÍ1NÍ4NÍ7NÍ9NÍ;NÍ=N)NNNNNNNNNNNNNNNNN)Ú__name__Ú
__module__Ú__qualname__r   ÚintrT   r   rM   r   r   re   r@   r<   r:   r   r      sw  „ ð +/Ø04Ø%)Ø!%Ø#'Ø#'Ø,0Ø!%ØØ26Ø6:Ø Ø"&Ø!Ø $Ø%)Ø!%ñ+K
ØðK
à�s˜C�x‘ðK
ð ˜C ˜H‘oðK
ð ð	K
ð
 ˜˜S™	 3˜Ñ'ðK
ð ˜D ™J¨Ð,Ñ-ðK
ð #ðK
ð ðK
ð �s˜C�x‘ðK
ð !ðK
ð    S ™/ðK
ð ðK
ð ðK
ð Ð.Ñ/ðK
ð Ð2Ñ3ðK
ð  ð!K
ð"  ð#K
ð$ ð%K
ð& ð'K
ð( #ð)K
ð* ð+K
ð, 
ˆoÑ	ô-K
r<   r   )r   Útypingr   r   r   Úpyrogramr   r   r	   r
   r   r@   r<   r:   ú<module>rl      s%   ðõ( ß (Ñ (ã ß -Ó -÷L
ò L
r<   