U
    ;g                     @   sB   d dl mZmZ d dlZd dlmZ d dlmZ G dd dZdS )    )UnionListN)raw)typesc                   @   s<   e Zd Zdeeeeef eeeef  f ddddZdS )CreateGroupzpyrogram.Clientz
types.Chat)selftitleusersreturnc                    sV   t |ts|g} tjjj| fdd|D I dH dI dH }tj	 |j
d S )aF  Create a new basic group.

        .. note::

            If you want to create a new supergroup, use :meth:`~pyrogram.Client.create_supergroup` instead.

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

        Parameters:
            title (``str``):
                The group title.

            users (``int`` | ``str`` | List of ``int`` or ``str``):
                Users to create a chat with.
                You must pass at least one user using their IDs (int), usernames (str) or phone numbers (str).
                Multiple users can be invited by passing a list of IDs, usernames or phone numbers.

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

        Example:
            .. code-block:: python

                await app.create_group("Group Title", user_id)
        c                    s   g | ]}  |I d H qS )N)Zresolve_peer).0ur    c/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/chats/create_group.py
<listcomp>?   s     z,CreateGroup.create_group.<locals>.<listcomp>N)r   r	   r   )
isinstancelistZinvoker   Z	functionsmessagesZ
CreateChatr   ZChatZ_parse_chatZchats)r   r   r	   rr   r   r   create_group   s    

zCreateGroup.create_groupN)__name__
__module____qualname__strr   intr   r   r   r   r   r   r      s
   r   )typingr   r   Zpyrogramr   r   r   r   r   r   r   <module>   s   