U
    ;g
                     @   s2   d dl mZ d dlZd dlmZ G dd dZdS )    )UnionN)rawc                   @   s(   e Zd Zdeeef eedddZdS )SetChatTitlezpyrogram.Client)selfchat_idtitlereturnc                    s   |  |I dH }t|tjjr@| tjjj|j	|dI dH  n>t|tjj
rn| tjjj||dI dH  ntd| ddS )al  Change the title of a chat.
        Titles can't be changed for private chats.
        You must be an administrator in the chat for this to work and must have the appropriate admin rights.

        Note:
            In regular groups (non-supergroups), this method will only work if the "All Members Are Admins"
            setting is off.

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

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

            title (``str``):
                New chat title, 1-255 characters.

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

        Raises:
            ValueError: In case a chat id belongs to user.

        Example:
            .. code-block:: python

                await app.set_chat_title(chat_id, "New Title")
        N)r   r   )Zchannelr   zThe chat_id "z" belongs to a userT)Zresolve_peer
isinstancer   typesZInputPeerChatZinvokeZ	functionsmessagesZEditChatTitler   ZInputPeerChannelZchannelsZ	EditTitle
ValueError)r   r   r   Zpeer r   e/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/chats/set_chat_title.pyset_chat_title   s"    !zSetChatTitle.set_chat_titleN)__name__
__module____qualname__r   intstrboolr   r   r   r   r   r      s
   
r   )typingr   Zpyrogramr   r   r   r   r   r   <module>   s   