o
    -˜Žjú  ã                   @   sN   d dl mZ d dlmZ d dlmZ d dlZd dlmZmZ G dd„ dƒZ	dS )é    )Údumps)Úrandint)ÚUnionN)ÚrawÚenumsc                   @   sN   e Zd Z					ddddeeef dddeded	ed
edddefdd„ZdS )ÚSendChatActionNÚselfzpyrogram.ClientÚchat_idÚactionzenums.ChatActionÚmessage_thread_idÚbusiness_connection_idÚemojiÚemoji_message_idÚemoji_message_interactionzraw.types.DataJSONÚreturnc                 Ã   s$  �|j  ¡ }d|v sd|v r|jdd�}nUd|v r(|du r!tdƒ‚|j|d�}nBd	|v rf|du s4|du r8tdƒ‚|du r]|  tj ¡ ¡I dH \}	}
tjjt	d
dt
d
|
jƒdœgdœƒd�}|j|||d�}n| ¡ }tjjj|  |¡I dH ||d�}|rŠ|  tjj||d�¡I dH S |  |¡I dH S )a/	  Tell the other party that something is happening on your side.

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

            action (:obj:`~pyrogram.enums.ChatAction`):
                Type of action to broadcast.

            message_thread_id (```int```):
                Unique identifier for the target message thread (topic) of the forum.
                for forum supergroups only.

            business_connection_id (``str``, *optional*):
                Business connection identifier.
                for business bots only.

            emoji (``str``, *optional*):
                The animated emoji. Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION` and :obj:`~pyrogram.enums.ChatAction.WATCH_EMOJI_ANIMATION`.

            emoji_message_id (``int``, *optional*):
                Message identifier of the message containing the animated emoji. Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION`.

            emoji_message_interaction (:obj:`raw.types.DataJSON`, *optional*):
                Only supported for :obj:`~pyrogram.enums.ChatAction.TRIGGER_EMOJI_ANIMATION`.

        Returns:
            ``bool``: On success, True is returned.

        Raises:
            ValueError: In case the provided string is not a valid chat action.

        Example:
            .. code-block:: python

                from pyrogram import enums

                # Send "typing" chat action
                await app.send_chat_action(chat_id, enums.ChatAction.TYPING)

                # Send "upload_video" chat action
                await app.send_chat_action(chat_id, enums.ChatAction.UPLOAD_VIDEO)

                # Send "playing" chat action
                await app.send_chat_action(chat_id, enums.ChatAction.PLAYING)

                # Cancel any current chat action
                await app.send_chat_action(chat_id, enums.ChatAction.CANCEL)
        ÚuploadÚhistoryr   )ÚprogressÚwatch_emojiNzInvalid Argument Provided)ÚemoticonÚtrigger_emojié   )ÚtÚi)ÚvÚa)Údata)r   Úmsg_idÚinteraction)Úpeerr
   Ú
top_msg_id)Úconnection_idÚquery)ÚnameÚlowerÚvalueÚ
ValueErrorÚ_get_raw_stickersr   ÚtypesÚ&InputStickerSetAnimatedEmojiAnimationsÚDataJSONr   r   ÚcountÚ	functionsÚmessagesÚ	SetTypingÚresolve_peerÚinvokeÚInvokeWithBusinessConnection)r   r	   r
   r   r   r   r   r   Úaction_nameÚ_Ústicker_setÚrpc© r6   úg/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/messages/send_chat_action.pyÚsend_chat_action   sh   €
Aÿÿÿþþÿþÿÿýýþ
ÿzSendChatAction.send_chat_action)NNNNN)Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrÚboolr8   r6   r6   r6   r7   r      s2    øÿ
þýüûúùø	÷r   )
Újsonr   Úrandomr   Útypingr   Úpyrogramr   r   r   r6   r6   r6   r7   Ú<module>   s   