U
    ;gt                     @   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)typesc                
   @   s6   e Zd Zddeeef eeeeed ddddZdS )	SendGameNzpyrogram.Client)ztypes.InlineKeyboardMarkupztypes.ReplyKeyboardMarkupztypes.ReplyKeyboardRemoveztypes.ForceReplyztypes.Message)selfchat_idgame_short_namedisable_notificationreply_to_message_idprotect_contentreply_markupreturnc           	         s   |  tjjj| |I dH tjjtjjtj	 |ddd|p@d|| 
 ||r^|| I dH nddI dH }|jD ]P}t|tjjtjjfrttj| |jdd |jD dd |jD I dH   S qtdS )	u  Send a game.

        .. include:: /_includes/usable-by/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).

            game_short_name (``str``):
                Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.

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

            reply_to_message_id (``int``, *optional*):
                If the message is a reply, ID of the original message.

            protect_content (``bool``, *optional*):
                Protects the contents of the sent message from forwarding and saving.

            reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
                An object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown automatically.
                If not empty, the first button must launch the game.

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

        Example:
            .. code-block:: python

                await app.send_game(chat_id, "gamename")
        N)Zbot_idZ
short_nameid )ZpeerZmediamessageZsilentZreply_to_msg_idZ	random_idZ
noforwardsr   c                 S   s   i | ]}|j |qS  r   .0ir   r   _/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/bots/send_game.py
<dictcomp>b   s      z&SendGame.send_game.<locals>.<dictcomp>c                 S   s   i | ]}|j |qS r   r   r   r   r   r   r   c   s      )Zinvoker   Z	functionsmessagesZ	SendMediaZresolve_peerr   ZInputMediaGameZInputGameShortNameZInputUserSelfZrnd_idwriteZupdates
isinstanceZUpdateNewMessageZUpdateNewChannelMessageMessage_parser   ZusersZchats)	r   r   r   r	   r
   r   r   rr   r   r   r   	send_game   s2    1

 zSendGame.send_game)NNNN)__name__
__module____qualname__r   intstrboolr   r   r   r   r   r      s        
r   )typingr   Zpyrogramr   r   r   r   r   r   r   <module>   s   