
    N[iU                     <    d dl mZ d dlZd dlmZmZ  G d d      Zy)    )UnionN)rawtypesc                   <    e Zd Z	 	 ddddeeef   dedededdfd	Zy
)PinChatMessageselfzpyrogram.Clientchat_id
message_iddisable_notification
both_sidesreturnztypes.Messagec           	        K   | j                  t        j                  j                  j	                  | j                  |       d{   ||xs d| xs d             d{   }|j                  D ci c]  }|j                  | }}|j                  D ci c]  }|j                  | }	}|j                  D ]v  }
t        |
t        j                  j                  t        j                  j                  f      sBt        j                  j                  | |
j                   ||	       d{   c S  y7 7 c c}w c c}w 7 w)a_  Pin a message in a group, channel or your own chat.
        You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin right in
        the supergroup or "can_edit_messages" admin right in the channel.

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

        Parameters:
            chat_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target chat.

            message_id (``int``):
                Identifier of a message to pin.

            disable_notification (``bool``, *optional*):
                Pass True, if it is not necessary to send a notification to all chat members about the new pinned
                message. Notifications are always disabled in channels.

            both_sides (``bool``, *optional*):
                Pass True to pin the message for both sides (you and recipient).
                Applicable to private chats only. Defaults to False.

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

        Example:
            .. code-block:: python

                # Pin with notification
                await app.pin_chat_message(chat_id, message_id)

                # Pin without notification
                await app.pin_chat_message(chat_id, message_id, disable_notification=True)
        N)peeridsilent
pm_oneside)invoker   	functionsmessagesUpdatePinnedMessageresolve_peerusersr   chatsupdates
isinstancer   UpdateNewMessageUpdateNewChannelMessageMessage_parsemessage)r   r	   r
   r   r   rur   cr   is              Z/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/chats/pin_chat_message.pypin_chat_messagezPinChatMessage.pin_chat_message   s    P ++MM""66,,W55+3t)>1T	 7 
 
 #$''*Qq**"#''*Qq** 	QA!cii88!ii??A B"]]11$		5%PPP	Q 6
 +*
 QsU   AED5E"D7#E5D9	ED>-AE=/E,E-	E7E9EN)FF)__name__
__module____qualname__r   intstrboolr&        r%   r   r      sV    
 &+ 7Q7QsCx7Q 7Q #	7Q
 7Q 
7Qr.   r   )typingr   pyrogramr   r   r   r-   r.   r%   <module>r1      s   &   8Q 8Qr.   