o
    -˜ŽjÁ  ã                   @   sV   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 G dd„ dƒZ	dS )é    )Údatetime)ÚUnionÚListÚIterableN)ÚrawÚutils)Útypesc                   @   s„   e Zd Z								ddddeeef deeef deeee f deded	ed
edededededede	d f fdd„Z
dS )ÚForwardMessagesNÚselfzpyrogram.ClientÚchat_idÚfrom_chat_idÚmessage_idsÚmessage_thread_idÚdisable_notificationÚschedule_dateÚprotect_contentÚallow_paid_broadcastÚdrop_authorÚremove_captionÚnew_video_start_timestampÚreturnztypes.Messagec                 ƒ   s  �t |tƒ }|rt|ƒn|g}ˆ  tjjjˆ  |¡I dH ˆ  |¡I dH |||p)d‡ fdd„|D ƒt	 
|¡|||	|
|d�¡I dH }g }dd„ |jD ƒ}dd„ |jD ƒ}|jD ] }t |tjjtjjtjjfƒrv| tj ˆ |j||¡I dH ¡ qV|r~t |¡S |d S )	ab  Forward messages of any kind.

        .. 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 message 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_ids (``int`` | Iterable of ``int``):
                An iterable of message identifiers in the chat specified in *from_chat_id* or a single message id.

            message_thread_id (``int``, *optional*):
                Unique identifier of a message thread to which the message belongs.
                for supergroups only

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

            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.

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

            drop_author (``bool``, *optional*):
                Pass True to forwards messages without quoting the original author.
                
            remove_caption (``bool``, *optional*):
                Pass True to remove media captions of message copies.
                
            new_video_start_timestamp (``int``, *optional*):
                The new video start timestamp. Pass time to replace video start timestamp in the forwarded message.

        Returns:
            :obj:`~pyrogram.types.Message` | List of :obj:`~pyrogram.types.Message`: In case *message_ids* was not
            a list, a single message is returned, otherwise a list of messages is returned.

        Example:
            .. code-block:: python

                # Forward a single message
                await app.forward_messages(to_chat, from_chat, 123)

                # Forward multiple messages at once
                await app.forward_messages(to_chat, from_chat, [1, 2, 3])
        Nc                    s   g | ]}ˆ   ¡ ‘qS © )Úrnd_id)Ú.0Ú_©r
   r   úg/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/messages/forward_messages.pyÚ
<listcomp>q   ó    z4ForwardMessages.forward_messages.<locals>.<listcomp>)Úto_peerÚ	from_peerÚidÚ
top_msg_idÚsilentÚ	random_idr   Ú
noforwardsÚallow_paid_floodskipr   Údrop_media_captionsÚvideo_timestampc                 S   ó   i | ]}|j |“qS r   ©r!   ©r   Úir   r   r   Ú
<dictcomp>}   r   z4ForwardMessages.forward_messages.<locals>.<dictcomp>c                 S   r)   r   r*   r+   r   r   r   r-   ~   r   r   )Ú
isinstanceÚintÚlistÚinvoker   Ú	functionsÚmessagesr	   Úresolve_peerr   Údatetime_to_timestampÚusersÚchatsÚupdatesr   ÚUpdateNewMessageÚUpdateNewChannelMessageÚUpdateNewScheduledMessageÚappendÚMessageÚ_parseÚmessager   )r
   r   r   r   r   r   r   r   r   r   r   r   Úis_iterableÚrÚforwarded_messagesr6   r7   r,   r   r   r   Úforward_messages   sF   €Jô
ÿ

þþÿ€z ForwardMessages.forward_messages)NNNNNNNN)Ú__name__Ú
__module__Ú__qualname__r   r/   Ústrr   Úboolr   r   rC   r   r   r   r   r	      sH    ôÿ
þ
ýüûúùø	÷
öõôór	   )
r   Útypingr   r   r   Úpyrogramr   r   r   r	   r   r   r   r   Ú<module>   s   