o
    -˜Žjï  ã                   @   s:   d dl mZmZ d dlZd dlmZmZ G dd„ dƒZdS )é    )ÚUnionÚOptionalN)ÚrawÚutilsc                   @   sH   e Zd Z		ddddeeef dedeeef dee d	efd
d„ZdS )ÚRequestCallbackAnswerNé
   Úselfzpyrogram.ClientÚchat_idÚ
message_idÚcallback_dataÚpasswordÚtimeoutc                 Ã   sv   �t |tƒrt|dƒn|}|r!|  tjj ¡ ¡I dH }t 	||¡}| jtjj
j|  |¡I dH |||d�d|d�I dH S )aN  Request a callback answer from bots.
        This is the equivalent of clicking an inline button containing callback data.

        .. include:: /_includes/usable-by/users.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 user profile/chat public link in form of *t.me/<username>* (str).

            message_id (``int``):
                The message id the inline keyboard is attached on.

            callback_data (``str`` | ``bytes``):
                Callback data associated with the inline button you want to get the answer from.

            password (``str``, *optional*):
                When clicking certain buttons (such as BotFather's confirmation button to transfer ownership), if your account has 2FA enabled, you need to provide your account's password.
                The 2-step verification password for the current user. Only applicable, if the :obj:`~pyrogram.types.InlineKeyboardButton` contains ``callback_data_with_password``.

            timeout (``int``, *optional*):
                Timeout in seconds.

        Returns:
            The answer containing info useful for clients to display a notification at the top of the chat screen
            or as an alert.

        Raises:
            TimeoutError: In case the bot fails to answer within 10 seconds.
            ValueError: In case of invalid arguments.
            RPCError: In case of Telegram RPC error.

        Example:
            .. code-block:: python

                await app.request_callback_answer(chat_id, message_id, "callback_data")
        zutf-8N)ÚpeerÚmsg_idÚdatar   r   )Úretriesr   )Ú
isinstanceÚstrÚbytesÚinvoker   Ú	functionsÚaccountÚGetPasswordr   Úcompute_password_checkÚmessagesÚGetBotCallbackAnswerÚresolve_peer)r   r	   r
   r   r   r   r   Úr© r   új/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/bots/request_callback_answer.pyÚrequest_callback_answer   s"   €1

ÿüøz-RequestCallbackAnswer.request_callback_answer)Nr   )	Ú__name__Ú
__module__Ú__qualname__r   Úintr   r   r   r    r   r   r   r   r      s     úÿ
þý
üûúr   )Útypingr   r   Úpyrogramr   r   r   r   r   r   r   Ú<module>   s   