
    ;Si1
                         d Z ddlZddlZddlZddlmZmZmZmZm	Z	 ddl
mZ ddlmZ ddlmZmZmZ ddlmZmZmZmZmZmZmZmZ dd	lmZ dd
lmZ d Zd Z  e eeeeeeeeeee        eed       g dZ!y)aH  
This magical module will rewrite all public methods in the public interface
of the library so they can run the loop on their own if it's not already
running. This rewrite may not be desirable if the end user always uses the
methods they way they should be ran, but it's incredibly useful for quick
scripts and the runtime overhead is relatively low.

Some really common methods which are hardly used offer this ability by
default, such as ``.start()`` and ``.run_until_disconnected()`` (since
you may want to start, and then run until disconnected while using async
event handlers).
    N   )eventserrorsutils
connectionhelpers)_TakeoutClient)TelegramClient)types	functionscustom)DraftDialogMessageButtonForwardButtonMessageInlineResultConversation)
ChatGetter)SenderGetterc                     t        | |      t        j                        fd       }t        |d       t        | ||       y )Nc                       | i |}t        j                         }|j                         r|S |j                  |      S )N)r   get_running_loop
is_runningrun_until_complete)argskwargscoroloopmethods       R/var/www/OnlineNewsSite/project/venv/lib/python3.12/site-packages/telethon/sync.py	syncifiedz _syncify_wrap.<locals>.syncified    s@    t&v&'')??K**400    z	__tl.sync)getattr	functoolswrapssetattr)tmethod_namer#   r!   s      @r"   _syncify_wrapr+      sD    Q$F__V1 1 I{F+A{I&r$   c                      | D ]U  }t        |      D ]E  }|j                  d      r|dk(  st        j                  t	        ||            s:t        ||       G W y)z
    Converts all the methods in the given types (class definitions)
    into synchronous, which return either the coroutine or the result
    based on whether ``asyncio's`` event loop is running.
    ___call__N)dir
startswithinspectiscoroutinefunctionr%   r+   )r   r)   names      r"   syncifyr4   .   sX      +F 	+D??3'4:+=..wq$/?@!!T*	++r$   _get_result)	r
   r   r   r   r   r   r   r   r   )"__doc__asyncior&   r1    r   r   r   r   r   client.accountr	   client.telegramclientr
   tlr   r   r   	tl.customr   r   r   r   r   r   r   r   tl.custom.chatgetterr   tl.custom.sendergetterr   r+   r4   __all__ r$   r"   <module>rA      s}       8 8 * 1 ( (   - 0'"+  v}L'7L,P lM *r$   