U
    ;g                     @   sN   d dl m Z  d dlmZ d dlZd dlmZmZ d dlmZ G dd dZdS )    )datetime)UnionN)rawutils)typesc                   @   s<   e Zd Ze fdeeef eeef deddddZ	dS )RestrictChatMemberzpyrogram.Clientztypes.ChatPermissionsz
types.Chat)selfchat_iduser_idpermissions
until_datereturnc                    s   |  tjjj| |I dH | |I dH tjjt	||j
 |j |j |j |j |j |j |j |j |j |j ddI dH }tj| |jd S )aH  Restrict a user in a supergroup.

        You must be an administrator in the supergroup for this to work and must have the appropriate admin rights.
        Pass True for all permissions to lift restrictions from a user.

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

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

            user_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target user.
                For a contact that exists in your Telegram address book you can use his phone number (str).

            permissions (:obj:`~pyrogram.types.ChatPermissions`):
                New user permissions.

            until_date (:py:obj:`~datetime.datetime`, *optional*):
                Date when the user will be unbanned.
                If user is banned for more than 366 days or less than 30 seconds from the current time they are
                considered to be banned forever. Defaults to epoch (ban forever).

        Returns:
            :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.

        Example:
            .. code-block:: python

                from datetime import datetime, timedelta
                from pyrogram.types import ChatPermissions

                # Completely restrict chat member (mute) forever
                await app.restrict_chat_member(chat_id, user_id, ChatPermissions())

                # Chat member muted for 24h
                await app.restrict_chat_member(chat_id, user_id, ChatPermissions(),
                    datetime.now() + timedelta(days=1))

                # Chat member can only send text messages
                await app.restrict_chat_member(chat_id, user_id,
                    ChatPermissions(can_send_messages=True))
        N)r   Zsend_messagesZ
send_mediaZsend_stickersZ	send_gifsZ
send_gamesZsend_inlineZembed_linksZ
send_pollsZchange_infoZinvite_usersZpin_messages)ZchannelZparticipantZbanned_rightsr   )Zinvoker   Z	functionsZchannelsZ
EditBannedZresolve_peerr   ZChatBannedRightsr   Zdatetime_to_timestampZcan_send_messagesZcan_send_media_messagesZcan_send_other_messagesZcan_add_web_page_previewsZcan_send_pollsZcan_change_infoZcan_invite_usersZcan_pin_messagesZChatZ_parse_chatZchats)r   r	   r
   r   r   r r   k/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/chats/restrict_chat_member.pyrestrict_chat_member   s*    2
z'RestrictChatMember.restrict_chat_memberN)
__name__
__module____qualname__r   Zzero_datetimer   intstrr   r   r   r   r   r   r      s   

r   )r   typingr   Zpyrogramr   r   r   r   r   r   r   r   <module>   s
   