Ë
    žDjK  ã                   óP   — d dl m Z  d dlmZmZ d dlZd dlmZmZmZ  G d„ d«      Zy)é    )Údatetime)ÚUnionÚListN)ÚtypesÚutilsÚrawc                   ól   — 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d	ed
eded   fd„Z	y)ÚCopyMediaGroupNÚselfzpyrogram.ClientÚchat_idÚfrom_chat_idÚ
message_idÚcaptionsÚdisable_notificationÚreply_to_message_idÚschedule_dateÚreturnztypes.Messagec              ƒ   ó’  K  — | 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                  |¬«      }|	j                  t        j                  j                  d|| j                  «       dœ| j                  j!                  t#        |t$        «      r|
t'        |«      k  r
||
   r||
   nPt#        |t(        «      r|
dk(  r|n9|j*                  r,|j*                  dk7  rt-        |«      t(        ur|j*                  nd«      ƒ d{  –—† ¤Ž«       �Œ� | j/                  t        j0                  j2                  j5                  | j7                  |«      ƒ d{  –—† |	|xs d|t        j8                  |«      ¬«      d	¬
«      ƒ d{  –—† }t        j:                  | t        j                  j2                  j=                  t?        d„ |j@                  «      D �cg c]  }|jB                  ‘Œ c}|jD                  |jF                  ¬«      «      ƒ d{  –—† S 7 �Œž7 �Œ7 ŒÁ7 Œ•c c}w 7 Œ­w)a›	  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).

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

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

            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.

        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)ÚmediaÚ	random_idr   ÚNoneÚ )ÚpeerÚmulti_mediaÚsilentÚreply_to_msg_idr   é<   )Úsleep_thresholdc                 ó°   — t        | t        j                  j                  t        j                  j                  t        j                  j
                  f«      S )N)Ú
isinstancer   r   ÚUpdateNewMessageÚUpdateNewChannelMessageÚUpdateNewScheduledMessage)Úus    úZ/root/auto/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© )$Úget_media_groupÚ	enumerateÚphotor   ÚaudioÚdocumentÚvideoÚ
ValueErrorr   Úget_input_media_from_file_idÚappendr   r   ÚInputSingleMediaÚrnd_idÚparserÚparser!   ÚlistÚlenÚstrÚcaptionÚtypeÚinvokeÚ	functionsr)   ÚSendMultiMediaÚresolve_peerÚdatetime_to_timestampÚparse_messagesÚMessagesÚfilterÚupdatesÚmessager*   r+   )r   r   r   r   r   r   r   r   Úmedia_groupr   ÚirH   r   r   ÚrÚms                   r&   Úcopy_media_groupzCopyMediaGroup.copy_media_group   si  è ø€ ð| !×0Ñ0°¸zÓJ×JˆØˆä# KÓ0ó 	‰JˆAˆwØ�}Š}Ø!Ÿ-™-×/Ñ/‘Ø—’Ø!Ÿ-™-×/Ñ/‘Ø×!Ò!Ø!×*Ñ*×2Ñ2‘Ø—’Ø!Ÿ-™-×/Ñ/‘ä Ð!JÓKÐKä×6Ñ6¸wÔGˆEØ×ÑÜ—	‘	×*Ñ*ð ØØ"Ÿk™k›mñð !ŸK™K×-Ñ-Ü'1°(¼DÔ'AÀaÌ#ÈhË-ÒFWÐ\dÐefÒ\g˜ šÜ$.¨x¼Ô$=À!ÀqÂ&™Ø+2¯?ª?¸w¿¹ÐRXÒ?XÔaeØ$ób&Ü),ñb-˜ŸšØ24ó	6÷ 6ñö
ð	ð2 —+‘+Ü�M‰M×"Ñ"×1Ñ1Ø×,Ñ,¨WÓ5×5Ø'Ø+Ò3¨tØ 3Ü#×9Ñ9¸-ÓHð 2ó ð ð ó 	
÷ 	
ˆô ×)Ñ)ØÜ�I‰I×Ñ×'Ñ'Ü-3ñSð —I‘Ió	.ö ¨˜!Ÿ)›)ò ð —g‘gØ—g‘gð (ó 	ó
÷ 
ð 	
ðO Kùð(6ùð 6øð	
úòð
úsf   ‚K˜J6™FKÆ*J9Æ+AKÇ:J<Ç;-KÈ(J>È)AKÉ9K Ê%KÊ1KÊ2KÊ9KÊ<KÊ>KË K)NNNN)
Ú__name__Ú
__module__Ú__qualname__r   Úintr<   r   Úboolr   rM   r,   r(   r&   r
   r
      s—   „ ð +/Ø%)Ø#'Ø"&ñq
Øðq
à�s˜C�x‘ðq
ð ˜C ˜H‘oðq
ð ð	q
ð
 ˜˜S™	 3˜Ñ'ðq
ð #ðq
ð !ðq
ð  ðq
ð 
ˆoÑ	ôq
r(   r
   )	r   Útypingr   r   Úpyrogramr   r   r   r
   r,   r(   r&   ú<module>rU      s"   ðõ& ß ã ß &Ñ &÷r
ò r
r(   