o
    -˜Žj­
  ã                   @   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ddeeef dedefdd„ZdS )	ÚSetChatTitleÚselfzpyrogram.ClientÚchat_idÚtitleÚreturnc                 Ã   s„   �|   |¡I dH }t|tjjƒr"|  tjjj|j	|d�¡I dH  dS t|tjj
ƒr:|  tjjj||d�¡I dH  dS td|› d�ƒ‚)aÂ  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.
                You can also use chat public link in form of *t.me/<username>* (str).

            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   )Úchannelr   zThe chat_id "z" belongs to a userT)Úresolve_peerÚ
isinstancer   ÚtypesÚInputPeerChatÚinvokeÚ	functionsÚmessagesÚEditChatTitler   ÚInputPeerChannelÚchannelsÚ	EditTitleÚ
ValueError)r   r   r   Úpeer© r   úb/var/www/kodo/Anonymous/send/lib/python3.10/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   Úpyrogramr   r   r   r   r   r   Ú<module>   s   