U
    h                     @   s\   d Z ddlmZmZ ddlmZ eee  ee dddZeee  ee ddd	Z	d
S )aK  This module contains helper functions related to parsing updates and their contents.

.. versionadded:: 20.8

Warning:
    Contents of this module are intended to be used internally by the library and *not* by the
    user. Changes to this module are not considered breaking changes and may not be documented in
    the changelog.
    )	FrozenSetOptional)SCT)chat_idreturnc                 C   s*   | dkrt  S t| tr"t | hS t | S )zPAccepts a chat id or collection of chat ids and returns a frozenset of chat ids.N)	frozenset
isinstanceint)r    r
   G/tmp/pip-unpacked-wheel-6scrnegd/telegram/ext/_utils/_update_parsing.pyparse_chat_id!   s
    

r   )usernamer   c                 C   sJ   | dkrt  S t| tr8t | dr0| dd n| hS t dd | D S )zAccepts a username or collection of usernames and returns a frozenset of usernames.
    Strips the leading ``@`` if present.
    N@   c                 S   s&   h | ]}| d r|dd n|qS )r   r   N)
startswith).0Zusrr
   r
   r   	<setcomp>2   s     z!parse_username.<locals>.<setcomp>)r   r   strr   )r   r
   r
   r   parse_username*   s
    
 r   N)
__doc__typingr   r   Ztelegram._utils.typesr   r	   r   r   r   r
   r
   r
   r   <module>   s   		