o
    -˜ŽjÄ  ã                   @   s>   d dl mZ d dlZd dlmZ ddlmZ G dd„ dƒZdS )é    )ÚUnionN)Úrawé   )Úget_sessionc                   @   s8   e Zd Z		ddddeeef dededef
d	d
„ZdS )ÚUnpinChatMessager   NÚselfzpyrogram.ClientÚchat_idÚ
message_idÚbusiness_connection_idÚreturnc                 Ã   sš   �t jjj|  |¡I dH |dd�}d}d}|r1| j| }|s&|  |¡I dH }t| |jj	j
ƒI dH }|rC| t jj||d�¡I dH  dS |  |¡I dH  dS )a)  Unpin 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``, *optional*):
                Identifier of a message to unpin.
                Required if ``business_connection_id`` is specified.
                If not specified, the most recent pinned message (by sending date) will be unpinned.

            business_connection_id (``str``, *optional*):
                Unique identifier of the business connection on behalf of which the message will be unpinned.

        Returns:
            ``bool``: True on success.

        Example:
            .. code-block:: python

                await app.unpin_chat_message(chat_id, message_id)
        NT)ÚpeerÚidÚunpin)ÚqueryÚconnection_id)r   Ú	functionsÚmessagesÚUpdatePinnedMessageÚresolve_peerÚbusiness_user_connection_cacheÚget_business_connectionr   Ú_rawÚ
connectionÚdc_idÚinvokeÚInvokeWithBusinessConnection)r   r   r	   r
   ÚrpcÚsessionÚbusiness_connection© r   úf/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/chats/unpin_chat_message.pyÚunpin_chat_message   s4   € ý

þþ
ÿ	þz#UnpinChatMessage.unpin_chat_message)r   N)Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrÚboolr!   r   r   r   r    r      s    üÿ
þýüûr   )Útypingr   Úpyrogramr   Úmessages.inline_sessionr   r   r   r   r   r    Ú<module>   s
   