L iJL UdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZmZmZddlmZddlmZddlmZmZddlmZmZmZmZmZmZm Z m!Z!dd l"m#Z#dd l$m%Z%m&Z&m'Z'm(Z(m)Z)dd l*m+Z+dd l,m-Z-dd l.m/Z/m0Z0m1Z1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ddl;mZ>ddl?m@Z@ddlAmBZBddlCmDZDddlEmFZFddlGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPddlQmRZRer&ddlSmSZSddlTmUZUddlVmWZWmXZXddlYmZZZddl[m\Z\ddl]m^Z^dZ_e`ead <e d!d"#ZbecZde)dZee jd$k\re eMZgne!ed%deMfe eMfZgeegeMZhe+eiZjGd&d'ekZlGd(d"ejd"eeIeJeNeKeHeLfZny))z+This module contains the Application class.N) defaultdict) Awaitable Coroutine GeneratorMappingSequence)deepcopy)Path)MappingProxyType TracebackType) TYPE_CHECKINGAnyCallableGenericNoReturnOptionalTypeVarUnion)Update) DEFAULT_80 DEFAULT_IP DEFAULT_NONE DEFAULT_TRUE DefaultValue) get_logger)build_repr_with_selected_attrs)SCTDVTypeODVInput TimePeriod)warn) TelegramError)BasePersistence) ContextTypes)ExtBot) BaseHandler)Updater)network_retry_loop) was_called_by) TrackingDict) BDBTCCTCDJQRTUDConversationKeyHandlerCallback)PTBDeprecationWarning)socket)Message)ConversationHandlerJobQueue)InitApplicationBuilder)BaseUpdateProcessor)Job DEFAULT_GROUP_AppType Application)bound zasyncio.Future[object]c8eZdZdZdZddeeddffd ZxZS)ApplicationHandlerStopa Raise this in a handler or an error handler to prevent execution of any other handler (even in different groups). In order to use this exception in a :class:`telegram.ext.ConversationHandler`, pass the optional :paramref:`state` parameter instead of returning the next state: .. code-block:: python async def conversation_callback(update, context): ... raise ApplicationHandlerStop(next_state) Note: Has no effect, if the handler or error handler is run in a non-blocking way. Args: state (:obj:`object`, optional): The next state of the conversation. Attributes: state (:obj:`object`): Optional. The next state of the conversation. )stateNrEreturnc0t|||_yN)super__init__rE)selfrE __class__s _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/ext/_application.pyrJzApplicationHandlerStop.__init__qs ', rH) __name__ __module__ __qualname____doc__ __slots__robjectrJ __classcell__)rLs@rMrDrDWs,.I-hv.-$--rNrDc#ZeZdZdZdej dk\rdndzZddded d d ee d e d ddee e e efdeee e efdeedgeeedffdeedgeeedffdeedgeeedfffdZdedefdZdeeedeedeeddfdZdefdZedefdZede fdZ!ededfd Z"edzd!Z#e$de%fd"Z&e$d{d#Z'd|d$Z(d|d%Z)d}d'Z*d|d(Z+d|d)Z,d|d*Z-d|d+Z.d|d,Z/d-e0jbd./d0ddd1e2fd2e3d3e4d4e d5ee5ed6eed7ed8e6e5e ddfd9Z7e8e9d:ddd0ddddd;d1e2ddfded?ee;ee d~dJed8e6e5e d4e d7eddf dKZ? dddLdMe@eAdNeeBdOeeddPfdQZC ddMe@eAdNeeBdRedOeeddPf dSZDdTeEjddfdUZG ddMe@eAdNeeBdRedeAfdVZHd|dWZId|dXZJdNeBddfdYZKdNeBddfdZZLeMfd&eNeeefd[e ddfd\ZOePfd]e;e5eNeeefeQe e5eNeeefffd[e;e eRe fddfd^ZSeMfd&eNeeefd[e ddfd_ZTd`e ddfdaZUdbe ddfdcZV dddededfee dgee ddfdhZWdddidNeeBdjedkddfdlZX ddmeeYe dneeYe ddfdoZZd|dpZ[d|dqZ\d|drZ]e^fdse_eBedfdte:eddfduZ`dse_eBedfddfdvZa ddNeeBdwebdjedxdMeeceAdef dyZdy)r>aThis class dispatches all kinds of updates to its registered handlers, and is the entry point to a PTB application. Tip: This class may not be initialized directly. Use :class:`telegram.ext.ApplicationBuilder` or :meth:`builder` (for convenience). Instances of this class can be used as asyncio context managers, where .. code:: python async with application: # code is roughly equivalent to .. code:: python try: await application.initialize() # code finally: await application.shutdown() .. seealso:: :meth:`__aenter__` and :meth:`__aexit__`. This class is a :class:`~typing.Generic` class and accepts six type variables: 1. The type of :attr:`bot`. Must be :class:`telegram.Bot` or a subclass of that class. 2. The type of the argument ``context`` of callback functions for (error) handlers and jobs. Must be :class:`telegram.ext.CallbackContext` or a subclass of that class. This must be consistent with the following types. 3. The type of the values of :attr:`user_data`. 4. The type of the values of :attr:`chat_data`. 5. The type of :attr:`bot_data`. 6. The type of :attr:`job_queue`. Must either be :class:`telegram.ext.JobQueue` or a subclass of that or :obj:`None`. Examples: :any:`Echo Bot ` .. seealso:: :wiki:`Your First Bot `, :wiki:`Architecture Overview ` .. versionchanged:: 20.0 * Initialization is now done through the :class:`telegram.ext.ApplicationBuilder`. * Removed the attribute ``groups``. Attributes: bot (:class:`telegram.Bot`): The bot object that should be passed to the handlers. update_queue (:class:`asyncio.Queue`): The synchronized queue that will contain the updates. updater (:class:`telegram.ext.Updater`): Optional. The updater used by this application. chat_data (:obj:`types.MappingProxyType`): A dictionary handlers can use to store data for the chat. For each integer chat id, the corresponding value of this mapping is available as :attr:`telegram.ext.CallbackContext.chat_data` in handler callbacks for updates from that chat. .. versionchanged:: 20.0 :attr:`chat_data` is now read-only. Note that the values of the mapping are still mutable, i.e. editing ``context.chat_data`` within a handler callback is possible (and encouraged), but editing the mapping ``application.chat_data`` itself is not. .. tip:: * Manually modifying :attr:`chat_data` is almost never needed and unadvisable. * Entries are never deleted automatically from this mapping. If you want to delete the data associated with a specific chat, e.g. if the bot got removed from that chat, please use :meth:`drop_chat_data`. user_data (:obj:`types.MappingProxyType`): A dictionary handlers can use to store data for the user. For each integer user id, the corresponding value of this mapping is available as :attr:`telegram.ext.CallbackContext.user_data` in handler callbacks for updates from that user. .. versionchanged:: 20.0 :attr:`user_data` is now read-only. Note that the values of the mapping are still mutable, i.e. editing ``context.user_data`` within a handler callback is possible (and encouraged), but editing the mapping ``application.user_data`` itself is not. .. tip:: * Manually modifying :attr:`user_data` is almost never needed and unadvisable. * Entries are never deleted automatically from this mapping. If you want to delete the data associated with a specific user, e.g. if that user blocked the bot, please use :meth:`drop_user_data`. bot_data (:obj:`dict`): A dictionary handlers can use to store data for the bot. persistence (:class:`telegram.ext.BasePersistence`): The persistence class to store data that should be persistent over restarts. handlers (dict[:obj:`int`, list[:class:`telegram.ext.BaseHandler`]]): A dictionary mapping each handler group to the list of handlers registered to that group. .. seealso:: :meth:`add_handler`, :meth:`add_handlers`. error_handlers (dict[:term:`coroutine function`, :obj:`bool`]): A dictionary where the keys are error handlers and the values indicate whether they are to be run blocking. .. seealso:: :meth:`add_error_handler` context_types (:class:`telegram.ext.ContextTypes`): Specifies the types used by this dispatcher for the ``context`` argument of handler and job callbacks. post_init (:term:`coroutine function`): Optional. A callback that will be executed by :meth:`Application.run_polling` and :meth:`Application.run_webhook` after initializing the application via :meth:`initialize`. post_shutdown (:term:`coroutine function`): Optional. A callback that will be executed by :meth:`Application.run_polling` and :meth:`Application.run_webhook` after shutting down the application via :meth:`shutdown`. post_stop (:term:`coroutine function`): Optional. A callback that will be executed by :meth:`Application.run_polling` and :meth:`Application.run_webhook` after stopping the application via :meth:`stop`. .. versionadded:: 20.1 )__create_task_tasks__update_fetcher_task__update_persistence_event__update_persistence_lock__update_persistence_task__stop_running_marker _chat_data&_chat_ids_to_be_deleted_in_persistence&_chat_ids_to_be_updated_in_persistence#_conversation_handler_conversations _initialized _job_queue_running_update_processor _user_data&_user_ids_to_be_deleted_in_persistence&_user_ids_to_be_updated_in_persistencebotbot_data chat_data context_typeserror_handlershandlers persistence post_init post_shutdown post_stop update_queueupdater user_data)rA ) __weakref__rKz$Application[BT, CCT, UD, CD, BD, JQ]rhrrzasyncio.Queue[object]rs job_queueupdate_processorr:rnrkroNrprqc Bttjttj j dz s tdd||_||_ ||_ ||_ i|_ i|_ ||_| |_| |_||_|jj%|_t'|jj(|_t'|jj,|_t1|j*|_t1|j.|_d|_|rt5|t6s t9d||_t;|_t;|_t;|_ t;|_!i|_"d|_#d|_$||_%d|_&d|_'tQjR|_*tQjV|_,t;|_-tQjR|_.y)Nz_applicationbuilder.pyzE`Application` instances should be built via the `ApplicationBuilder`. stacklevelz9persistence must be based on telegram.ext.BasePersistenceF)/r)inspect currentframer __file__parentresolver!rhrrrkrsrmrlrorprqrdrirrtrerjr]r rn isinstancer# TypeErrorsetr_rgr^rfr`rarcrb!_Application__update_fetcher_task%_Application__update_persistence_taskasyncioEvent&_Application__update_persistence_eventLock%_Application__update_persistence_lock_Application__create_task_tasks!_Application__stop_running_marker) rKrhrrrsrxryrnrkrorprqs rMrJzApplication.__init__s(  "DN$9$9$A$A$CF^$^  W  3?` the App. Returns: The initialized App instance. Raises: :exc:`Exception`: If an exception is raised during initialization, :meth:`shutdown` is called in this case. N) initialize ExceptionshutdownrKs rM __aenter__zApplication.__aenter__gsG //# # # $ --/ ! !  s.A  A A?AAexc_typeexc_valexc_tbc@K|jd{y7w)z>|async_context_manager| :meth:`shuts down ` the App.N)r)rKrrrs rM __aexit__zApplication.__aexit__xsmmos c0t||jS)a"Give a string representation of the application in the form ``Application[bot=...]``. As this class doesn't implement :meth:`object.__str__`, the default implementation will be used, which is equivalent to :meth:`__repr__`. Returns: :obj:`str` )rh)rrhrs rM__repr__zApplication.__repr__s.dAArNc|jS)z}:obj:`bool`: Indicates if this application is running. .. seealso:: :meth:`start`, :meth:`stop` )rcrs rMrunningzApplication.runnings}}rNc.|jjS)a:obj:`int`: The number of concurrent updates that will be processed in parallel. A value of ``0`` indicates updates are *not* being processed concurrently. .. versionchanged:: 20.4 This is now just a shortcut to :attr:`update_processor.max_concurrent_updates `. .. seealso:: :wiki:`Concurrency` )rdmax_concurrent_updatesrs rMconcurrent_updateszApplication.concurrent_updatess%%<<` zqNo `JobQueue` set up. To use `JobQueue`, you must install PTB via `pip install "python-telegram-bot[job-queue]"`.r{r|)rbr!rs rMrxzApplication.job_queues+ ?? " B  rNc|jS)z:class:`telegram.ext.BaseUpdateProcessor`: The update processor used by this application. .. seealso:: :wiki:`Concurrency` .. versionadded:: 20.4 )rdrs rMryzApplication.update_processors%%%rNctrH) SystemExitrwrNrM_raise_system_exitzApplication._raise_system_exitsrNcddlm}|S)ztConvenience method. Returns a new :class:`telegram.ext.ApplicationBuilder`. .. versionadded:: 20.0 rApplicationBuilder) telegram.extrrs rMbuilderzApplication.builders "##rNc2|js tdy)NzBThis Application was not initialized via `Application.initialize`!)ra RuntimeErrorrs rM_check_initializedzApplication._check_initializeds   T !rNcK|jrtjdy|jj d{|j j d{|j r"|j j d{|jsd|_y|jd{ddl m }tjj|jjD]B}t!||s|j"s|j$s*|j'|d{Dd|_|j(j+y7%77772w)a<Initializes the Application by initializing: * The :attr:`bot`, by calling :meth:`telegram.Bot.initialize`. * The :attr:`updater`, by calling :meth:`telegram.ext.Updater.initialize`. * The :attr:`persistence`, by loading persistent conversations and data. * The :attr:`update_processor` by calling :meth:`telegram.ext.BaseUpdateProcessor.initialize`. Does *not* call :attr:`post_init` - that is only done by :meth:`run_polling` and :meth:`run_webhook`. .. seealso:: :meth:`shutdown` z(This Application is already initialized.NTrr7)ra_LOGGERdebugrhrrdrsrn_initialize_persistence*telegram.ext._handlers.conversationhandlerr7 itertoolschain from_iterablermvaluesr persistentname_add_ch_to_persistencerclear)rKr7handlers rMrzApplication.initializes,    MMD E hh!!###$$//111 <<,,))+ + + $D  **,,, S!44T]]5I5I5KL ;G'#67GE/?AE3 E3 E3*E3>E1?)E3*E3-E3/E31E3rctK|jj|j|d{y7 wrH)r`updater)rKrs rMrz"Application._add_ch_to_persistences. 007711$7 7 7s *86 8cdK|jr td|jstj dy|j j d{|jj d{|jr"|jj d{|jrdtj d|jd{|jjd{tj dd|_y7777I7)w)aShuts down the Application by shutting down: * :attr:`bot` by calling :meth:`telegram.Bot.shutdown` * :attr:`updater` by calling :meth:`telegram.ext.Updater.shutdown` * :attr:`persistence` by calling :meth:`update_persistence` and :meth:`BasePersistence.flush` * :attr:`update_processor` by calling :meth:`telegram.ext.BaseUpdateProcessor.shutdown` Does *not* call :attr:`post_shutdown` - that is only done by :meth:`run_polling` and :meth:`run_webhook`. .. seealso:: :meth:`initialize` Raises: :exc:`RuntimeError`: If the application is still :attr:`running`. z"This Application is still running!z1This Application is already shut down. Returning.Nz/Updating & flushing persistence before shutdownzUpdated and flushed persistenceF) rrrarrrhrrdrsrnupdate_persistenceflushrs rMrzApplication.shutdowns$ <<CD D  MMM N hh!!!$$--/// <<,,'') ) )    MMK L))+ + +""((* * * MM; <! "/ * , *sZAD0D&!D0;D(<-D0)D**8D0"D,#!D0D."D0(D0*D0,D0.D0c8K|jsy|jjjr;|jj |jj d{|jjj r;|jj |jjd{|jjjr}|jjd{|_ t|j|jjs,td|jjj|jjjr|j j"t|jj%d{}|Ot|t&rt)|dk7r td|j j"j+|yyyy77U77aw)zHThis method basically just loads all the data by awaiting the BP methodsNzbot_data must be of type r{z)callback_data must be a tuple of length 2)rn store_datartrer get_user_datarjr] get_chat_datari get_bot_datarrk ValueErrorrO callback_datarhcallback_data_cacheget_callback_datatuplelenload_persistence_data)rKpersistent_datas rMrz#Application._initialize_persistence-s     & & 0 0 OO " ")9)9)G)G)I#I J    & & 0 0 OO " ")9)9)G)G)I#I J    & & / /"&"2"2"?"?"AADMdmmT-?-?-H-HI /0B0B0K0K0T0T/UV    & & 4 4 HH ( ( 4$($4$4$F$F$HHO*!/59S=QUV=V$%PQQ,,BB#+ 5 5$J#IAIsLA H"H#AH=H>AHHB2H6H7AHHHHcK|jr td|jd|_|jj  |j rWtj|jd|jjd|_ tjd|jr7|jj!d{tjdtj|j#d|jjd |_tj'd y7q#t($r d |_wxYww) aStarts * a background task that fetches updates from :attr:`update_queue` and processes them via :meth:`process_update`. * :attr:`job_queue`, if set. * a background task that calls :meth:`update_persistence` in regular intervals, if :attr:`persistence` is set. Note: This does *not* start fetching updates from Telegram. To fetch updates, you need to either start :attr:`updater` manually or use one of :meth:`run_polling` or :meth:`run_webhook`. Tip: When using a custom logic for startup and shutdown of the application, eventual cancellation of pending tasks should happen only `after` :meth:`stop` has been called in order to ensure that the tasks mentioned above are not cancelled prematurely. .. seealso:: :meth:`stop` Raises: :exc:`RuntimeError`: If the application is already running or was not initialized. z$This Application is already running!T Application:z:persistence_updaterrz%Loop for updating persistence startedNzJobQueue startedz:update_fetcherzApplication startedF)rrrrcrrrnr create_task_persistence_updaterrhidrrrrbstart_update_fetcherrinforrs rMrzApplication.startJs2 <<EF F !  ''--/ 181D1D--/' }4HI2. EFoo++--- 01)0)<)<$$&|DHHKK=-X*D & LL. / . !DM  s2A E! B E E A0E E! E EE!cK|js tdd|_|jj t j d|jr|jjr |jjnr|jjtd{t jd|jj!d{|jd{t jd |j"rNt jd |j"j%d d{t jd t jd t'j(|j*ddid{|j,ri|j.r]t jd|j0j3|j.d{|j0j t j dy#t$r#}t jd|dYd}~]d}~wwxYw777p777qw)aStops the process after processing any pending updates or tasks created by :meth:`create_task`. Also stops :attr:`job_queue`, if set. Finally, calls :meth:`update_persistence` and :meth:`BasePersistence.flush` on :attr:`persistence`, if set. Warning: Once this method is called, no more updates will be fetched from :attr:`update_queue`, even if it's not empty. .. seealso:: :meth:`start` Note: * This does *not* stop :attr:`updater`. You need to either manually call :meth:`telegram.ext.Updater.stop` or use one of :meth:`run_polling` or :meth:`run_webhook`. * Does *not* call :attr:`post_stop` - that is only done by :meth:`run_polling` and :meth:`run_webhook`. Raises: :exc:`RuntimeError`: If the application is not running. z This Application is not running!Fz2Application is stopping. This might take a moment.zZFetching updates was aborted due to %r. Suppressing exception to ensure graceful shutdown.Texc_infoNz Waiting for update_queue to joinz(Application stopped fetching of updates.z"Waiting for running jobs to finish)waitzJobQueue stoppedz/Waiting for `create_task` calls to be processedreturn_exceptionsz&Waiting for persistence loop to finishzApplication.stop() complete)rrrcrrrrrdoneresult BaseExceptioncriticalrrput _STOP_SIGNALrjoinrbstoprgatherrrnrrr)rKexcs rMrzApplication.stops.||AB B  ""((* IJ  % %))..0..557''++L999 @A'',,...0000 @A ?? MM> ?//&&D&1 1 1 MM, - GHnnd66O$OOO    > > MMB C  + + / / 100 0 0  + + 1 1 3 23;%$$A!% %:.0 2 P 1sA4I97H:#I94I)56I9+I,,I9?I/AI9I2AI9*I5+AI9I74I9: I&I!I9!I&&I9,I9/I92I95I97I9c|jr#tjjy|jj |j stjdyy)a|This method can be used to stop the execution of :meth:`run_polling` or :meth:`run_webhook` from within a handler, job or error callback. This allows a graceful shutdown of the application, i.e. the methods listed in :attr:`run_polling` and :attr:`run_webhook` will still be executed. This method can also be called within :meth:`post_init`. This allows for a graceful, early shutdown of the application if some condition is met (e.g., a database connection could not be established). Note: If the application is not running and this method is not called within :meth:`post_init`, this method does nothing. Warning: This method is designed to for use in combination with :meth:`run_polling` or :meth:`run_webhook`. Using this method in combination with a custom logic for starting and stopping the application is not guaranteed to work as expected. Use at your own risk. .. versionadded:: 20.5 .. versionchanged:: 21.2 Added support for calling within :meth:`post_init`. zVApplication is not running and not initialized. `stop_running()` likely has no effect.N) rrget_running_looprrrrarrrs rM stop_runningzApplication.stop_runningsS2 <<  $ $ & + + -  & & * * ,$$ !%rNg )secondsrT poll_intervaltimeoutbootstrap_retriesallowed_updatesdrop_pending_updates close_loop stop_signalsc js tddtddffd }jjj |||||||||S)a5Convenience method that takes care of initializing and starting the app, polling updates from Telegram using :meth:`telegram.ext.Updater.start_polling` and a graceful shutdown of the app on exit. |app_run_shutdown| :paramref:`stop_signals`. The order of execution by :meth:`run_polling` is roughly as follows: - :meth:`initialize` - :meth:`post_init` - :meth:`telegram.ext.Updater.start_polling` - :meth:`start` - Run the application until the users stops it - :meth:`telegram.ext.Updater.stop` - :meth:`stop` - :meth:`post_stop` - :meth:`shutdown` - :meth:`post_shutdown` A small wrapper is passed to :paramref:`telegram.ext.Updater.start_polling.error_callback` which forwards errors occurring during polling to :meth:`registered error handlers `. The update parameter of the callback will be set to :obj:`None`. .. include:: inclusions/application_run_tip.rst .. versionchanged:: Removed the deprecated parameters ``read_timeout``, ``write_timeout``, ``connect_timeout``, and ``pool_timeout``. Use the corresponding methods in :class:`telegram.ext.ApplicationBuilder` instead. Args: poll_interval (:obj:`float`, optional): Time to wait between polling updates from Telegram in seconds. Default is ``0.0``. timeout (:obj:`int` | :class:`datetime.timedelta`, optional): Passed to :paramref:`telegram.Bot.get_updates.timeout`. Default is :obj:`timedelta(seconds=10)`. .. versionchanged:: v22.2 |time-period-input| bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase (calling :meth:`initialize` and the boostrapping of :meth:`telegram.ext.Updater.start_polling`) will retry on failures on the Telegram server. * < 0 - retry indefinitely * 0 - no retries (default) * > 0 - retry up to X times .. versionchanged:: 21.11 The default value will be changed to from ``-1`` to ``0``. Indefinite retries during bootstrapping are not recommended. drop_pending_updates (:obj:`bool`, optional): Whether to clean any pending updates on Telegram servers before actually starting to poll. Default is :obj:`False`. allowed_updates (Sequence[:obj:`str`], optional): Passed to :meth:`telegram.Bot.get_updates`. .. versionchanged:: 21.9 Accepts any :class:`collections.abc.Sequence` as input instead of just a list close_loop (:obj:`bool`, optional): If :obj:`True`, the current event loop will be closed upon shutdown. Defaults to :obj:`True`. .. seealso:: :meth:`asyncio.loop.close` stop_signals (Sequence[:obj:`int`] | :obj:`None`, optional): Signals that will shut down the app. Pass :obj:`None` to not use stop signals. Defaults to :data:`signal.SIGINT`, :data:`signal.SIGTERM` and :data:`signal.SIGABRT` on non Windows platforms. Caution: Not every :class:`asyncio.AbstractEventLoop` implements :meth:`asyncio.loop.add_signal_handler`. Most notably, the standard event loop on Windows, :class:`asyncio.ProactorEventLoop`, does not implement this method. If this method is not available, stop signals can not be set. Raises: :exc:`RuntimeError`: If the Application does not have an :class:`telegram.ext.Updater`. zLApplication.run_polling is only available if the application has an Updater.rrFNcJjj|dyN)errorr)r process_error)rrKs rMerror_callbackz/Application.run_polling..error_callbackDs!   T//c$/G HrN)rrrrrrupdater_coroutinerrr)rsrr"_Application__run start_polling) rKrrrrrrrrs ` rM run_pollingzApplication.run_pollingsr||^  I  I$ Izz"ll88+"3 /%9- 9&/!  rN(listenporturl_pathcertkey webhook_url ip_addressmax_connections secret_tokenunixr5c|js td|j|jj||||||| ||| | || | || S)aMConvenience method that takes care of initializing and starting the app, listening for updates from Telegram using :meth:`telegram.ext.Updater.start_webhook` and a graceful shutdown of the app on exit. |app_run_shutdown| :paramref:`stop_signals`. If :paramref:`cert` and :paramref:`key` are not provided, the webhook will be started directly on ``http://listen:port/url_path``, so SSL can be handled by another application. Else, the webhook will be started on ``https://listen:port/url_path``. Also calls :meth:`telegram.Bot.set_webhook` as required. The order of execution by :meth:`run_webhook` is roughly as follows: - :meth:`initialize` - :meth:`post_init` - :meth:`telegram.ext.Updater.start_webhook` - :meth:`start` - Run the application until the users stops it - :meth:`telegram.ext.Updater.stop` - :meth:`stop` - :meth:`post_stop` - :meth:`shutdown` - :meth:`post_shutdown` Important: If you want to use this method, you must install PTB with the optional requirement ``webhooks``, i.e. .. code-block:: bash pip install "python-telegram-bot[webhooks]" .. include:: inclusions/application_run_tip.rst .. seealso:: :wiki:`Webhooks` Args: listen (:obj:`str`, optional): IP-Address to listen on. Defaults to `127.0.0.1 `_. port (:obj:`int`, optional): Port the bot should be listening on. Must be one of :attr:`telegram.constants.SUPPORTED_WEBHOOK_PORTS` unless the bot is running behind a proxy. Defaults to ``80``. url_path (:obj:`str`, optional): Path inside url. Defaults to `` '' `` cert (:class:`pathlib.Path` | :obj:`str`, optional): Path to the SSL certificate file. key (:class:`pathlib.Path` | :obj:`str`, optional): Path to the SSL key file. bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase (calling :meth:`initialize` and the boostrapping of :meth:`telegram.ext.Updater.start_polling`) will retry on failures on the Telegram server. * < 0 - retry indefinitely * 0 - no retries (default) * > 0 - retry up to X times webhook_url (:obj:`str`, optional): Explicitly specify the webhook url. Useful behind NAT, reverse proxy, etc. Default is derived from :paramref:`listen`, :paramref:`port`, :paramref:`url_path`, :paramref:`cert`, and :paramref:`key`. allowed_updates (Sequence[:obj:`str`], optional): Passed to :meth:`telegram.Bot.set_webhook`. .. versionchanged:: 21.9 Accepts any :class:`collections.abc.Sequence` as input instead of just a list drop_pending_updates (:obj:`bool`, optional): Whether to clean any pending updates on Telegram servers before actually starting to poll. Default is :obj:`False`. ip_address (:obj:`str`, optional): Passed to :meth:`telegram.Bot.set_webhook`. max_connections (:obj:`int`, optional): Passed to :meth:`telegram.Bot.set_webhook`. Defaults to ``40``. close_loop (:obj:`bool`, optional): If :obj:`True`, the current event loop will be closed upon shutdown. Defaults to :obj:`True`. .. seealso:: :meth:`asyncio.loop.close` stop_signals (Sequence[:obj:`int`] | :obj:`None`, optional): Signals that will shut down the app. Pass :obj:`None` to not use stop signals. Defaults to :data:`signal.SIGINT`, :data:`signal.SIGTERM` and :data:`signal.SIGABRT`. Caution: Not every :class:`asyncio.AbstractEventLoop` implements :meth:`asyncio.loop.add_signal_handler`. Most notably, the standard event loop on Windows, :class:`asyncio.ProactorEventLoop`, does not implement this method. If this method is not available, stop signals can not be set. secret_token (:obj:`str`, optional): Secret token to ensure webhook requests originate from Telegram. See :paramref:`telegram.Bot.set_webhook.secret_token` for more details. When added, the web server started by this call will expect the token to be set in the ``X-Telegram-Bot-Api-Secret-Token`` header of an incoming request and will raise a :class:`http.HTTPStatus.FORBIDDEN ` error if either the header isn't set or it is set to a wrong token. .. versionadded:: 20.0 unix (:class:`pathlib.Path` | :obj:`str` | :class:`socket.socket`, optional): Can be either: * the path to the unix socket file as :class:`pathlib.Path` or :obj:`str`. This will be passed to `tornado.netutil.bind_unix_socket `_ to create the socket. If the Path does not exist, the file will be created. * or the socket itself. This option allows you to e.g. restrict the permissions of the socket for improved security. Note that you need to pass the correct family, type and socket options yourself. Caution: This parameter is a replacement for the default TCP bind. Therefore, it is mutually exclusive with :paramref:`listen` and :paramref:`port`. When using this param, you must also run a reverse proxy to the unix socket and set the appropriate :paramref:`webhook_url`. .. versionadded:: 20.8 .. versionchanged:: 21.1 Added support to pass a socket instance itself. zLApplication.run_webhook is only available if the application has an Updater.) rrrrrrrrrrrrr r)rsrr start_webhook)rKrrrrrrrrrrrrrrr s rM run_webhookzApplication.run_webhookUs}L||^ zz"ll88!"3%9' /% /)9&/!%  rN max_retriescRKt|jd|dd{y7w)Nz Bootstrap Initialize Application) action_cb descriptionr interval)r(r)rKr s rM_bootstrap_initializez!Application._bootstrap_initializes( oo:#    s '%'rc tj}|t urFt jdk7r/tjtjtjf} t|ts'|xsgD]}|j||j  |j%|j'||j(r |j%|j)||j*j-rt.j1d |j3 |j4j6r)|j%|j4j9|j6rK|j%|j9|j:r |j%|j;||j%|j=|j>r |j%|j?||r|j3yy|j%||j%|jA|jC|j3 |j4j6r)|j%|j4j9|j6rK|j%|j9|j:r |j%|j;||j%|j=|j>r |j%|j?||r|j3yy#t$r-tj}tj|YwxYw#t $r}t#d|d|ddYd}~'d}~wwxYw#|r|j3wwxYw#tDtFf$rt.jId YwxYw#|r|j3wwxYw#|j3 |j4j6r)|j%|j4j9|j6rK|j%|j9|j:r |j%|j;||j%|j=|j>r |j%|j?||r|j3ww#|r|j3wwxYwxYw) NWindowsz3Could not add signal handlers for the stop signals z due to exception `z_`. If your event loop does not implement `add_signal_handler`, please pass `stop_signals=None`.rAr|)r zCApplication received stop signal via `stop_running`. Shutting down.z0Application received stop signal. Shutting down.)%rget_event_looprnew_event_loopset_event_looprplatformsystemsignalSIGINTSIGTERMSIGABRTrradd_signal_handlerrNotImplementedErrorr!run_until_completerroris_setrrclosersrrrqrrpr run_foreverKeyboardInterruptrr)rKrrrrloopsigrs rM__runzApplication.__runs )))+D < 'HOO,=,J"MM6>>6>>JL lL9'-2JC++C1H1HIJ !  # #D$>$>K\$>$] ^~~''t(<=))002 bc  # # % !<<''++DLL,=,=,?@<<++DIIK8~~//t0DE'' 8%%++D,>,>t,DEJJL/  # #$5 6  # #DJJL 1      # # % !<<''++DLL,=,=,?@<<++DIIK8~~//t0DE'' 8%%++D,>,>t,DEJJLe )))+D  " "4 ( )#  El^T!W%44    LJJL)":. N MML M N(JJL  # # % !<<''++DLL,=,=,?@<<++DIIK8~~//t0DE'' 8%%++D,>,>t,DEJJL:JJLsM'%7N A=O#,C!O !AO#2C!P'2NN O)OO O #$P P& P  P&P#&U8C!T-U-UUr coroutinerrzasyncio.Task[RT]c*|j|||S)aThin wrapper around :func:`asyncio.create_task` that handles exceptions raised by the :paramref:`coroutine` with :meth:`process_error`. Note: * If :paramref:`coroutine` raises an exception, it will be set on the task created by this method even though it's handled by :meth:`process_error`. * If the application is currently running, tasks created by this method will be awaited with :meth:`stop`. .. seealso:: :wiki:`Concurrency` Args: coroutine (:term:`awaitable`): The awaitable to run as task. .. versionchanged:: 20.2 Accepts :class:`asyncio.Future` and generator-based coroutine functions. .. deprecated:: 20.4 Since Python 3.12, generator-based coroutine functions are no longer accepted. update (:obj:`object`, optional): If set, will be passed to :meth:`process_error` as additional information for the error handlers. Moreover, the corresponding :attr:`chat_data` and :attr:`user_data` entries will be updated in the next run of :meth:`update_persistence` after the :paramref:`coroutine` is finished. Keyword Args: name (:obj:`str`, optional): The name of the task. .. versionadded:: 20.4 Returns: :class:`asyncio.Task`: The created task. )r)rr)_Application__create_task)rKr)rrs rMrzApplication.create_task>sL!!If4!PPrNis_error_handlerctj|j||||}|jr8|jj ||j |j|Stdd|S)N)r)rr,rzpTasks created via `Application.create_task` while the application is not running won't be automatically awaited!rAr|) rr"_Application__create_task_callbackrraddadd_done_callback'_Application__create_task_done_callbackr!)rKr)rr,rtasks rM __create_taskzApplication.__create_taskfs")!4!4  ' '#FEU (  "  <<  $ $ ( ( .  " "4#C#C D :   rNr2c|jj|tjtj tj 5|jdddy#1swYyxYwrH)rdiscard contextlibsuppressrCancelledErrorInvalidStateError exception)rKr2s rM__create_task_done_callbackz'Application.__create_task_done_callbacksS   ((. !7!79R9R S  NN    s A((A1cK tjdkrTt|trDt t ddt j|d{|j|S|d{|j|S727#t$r[}t|trt dd|rtjd| |j||| d{7d}~wwxYw#|j|wxYww) Nr@z20.4zZGenerator-based coroutines are deprecated in create_task and will not work in Python 3.12+rzKApplicationHandlerStop is not supported with handlers running non-blocking.rr|dAn error was raised and an uncaught error was raised while handling the error with an error_handler.r)rrr))sys version_inforrr!r4rr_mark_for_persistence_updaterrDrr:r)rKr)rr,r:s rM__create_task_callbackz"Application.__create_task_callbacks & =')jI.N)0%00;;8  - -V - <3#?2  - -V - <9<# )%;<a ( "!!@&" ((iS\(]]] - 0  - -V - ?DM e##G,rNrmct|trt|ts tdt|trQ|j D]=\}}t|t std|d|D]}|j ||?yt|t r-|D]'}|j |tj|)ytd)a0Registers multiple handlers at once. The order of the handlers in the passed sequence(s) matters. See :meth:`add_handler` for details. .. versionadded:: 20.0 Args: handlers (Sequence[:class:`telegram.ext.BaseHandler`] | dict[int, Sequence[:class:`telegram.ext.BaseHandler`]]): Specify a sequence of handlers *or* a dictionary where the keys are groups and values are handlers. .. versionchanged:: 21.7 Accepts any :class:`collections.abc.Sequence` as input instead of just a list or tuple. group (:obj:`int`, optional): Specify which group the sequence of :paramref:`handlers` should be added to. Defaults to ``0``. Example:: app.add_handlers(handlers={ -1: [MessageHandler(...)], 1: [CallbackQueryHandler(...), CommandHandler(...)] } Raises: :exc:`TypeError`: If the combination of arguments is invalid. zBThe `group` argument can only be used with a sequence of handlers.zHandlers for group z must be a sequence of handlers.zThe `handlers` argument must be a sequence of handlers or a dictionary where the keys are groups and values are sequences of handlers.N)rr`rrrbrrd get_value)rKrmr] handler_group grp_handlersrs rM add_handlerszApplication.add_handlerssH h %j .M`a a h %/7~~/? =+ |!,9#-m_<\] ,=G$$Wm<=  =( +# I  ,*@*@*GH I] rNc||j|vr<|j|j||j|s|j|=yyy)a>Remove a handler from the specified group. Hint: This method currently has no influence on calls to :meth:`process_update` that are already in progress. .. warning:: This behavior should currently be considered an implementation detail and not as guaranteed behavior. Args: handler (:class:`telegram.ext.BaseHandler`): A :class:`telegram.ext.BaseHandler` instance. group (:obj:`object`, optional): The group identifier. Default is ``0``. N)rmremove)rKrr]s rMremove_handlerzApplication.remove_handlersN& dmmE* * MM% ' ' 0=='MM%(( +rNchat_idcr|jj|d|jj|y)aDrops the corresponding entry from the :attr:`chat_data`. Will also be deleted from the persistence on the next run of :meth:`update_persistence`, if applicable. Warning: When using :attr:`concurrent_updates` or the :attr:`job_queue`, :meth:`process_update` or :meth:`telegram.ext.Job.run` may re-create this entry due to the asynchronous nature of these features. Please make sure that your program can avoid or handle such situations. .. versionadded:: 20.0 Args: chat_id (:obj:`int`): The chat id to delete. The entry will be deleted even if it is not empty. N)r]popr^r/)rKrms rMdrop_chat_datazApplication.drop_chat_data, GT* 3377@rNuser_idcr|jj|d|jj|y)aDrops the corresponding entry from the :attr:`user_data`. Will also be deleted from the persistence on the next run of :meth:`update_persistence`, if applicable. Warning: When using :attr:`concurrent_updates` or the :attr:`job_queue`, :meth:`process_update` or :meth:`telegram.ext.Job.run` may re-create this entry due to the asynchronous nature of these features. Please make sure that your program can avoid or handle such situations. .. versionadded:: 20.0 Args: user_id (:obj:`int`): The user id to delete. The entry will be deleted even if it is not empty. N)rerorfr/)rKrrs rMdrop_user_datazApplication.drop_user_datarqrNmessager6 old_chat_id new_chat_idc|r|s|r tdt|||fs td|rl|j|j td|jxs|jj }|jxs|jj }n+t |trt |ts td|j||j|<|j||jj|y)aMoves the contents of :attr:`chat_data` at key :paramref:`old_chat_id` to the key :paramref:`new_chat_id`. Also marks the entries to be updated accordingly in the next run of :meth:`update_persistence`. Warning: * Any data stored in :attr:`chat_data` at key :paramref:`new_chat_id` will be overridden * The key :paramref:`old_chat_id` of :attr:`chat_data` will be deleted * This does not update the :attr:`~telegram.ext.Job.chat_id` attribute of any scheduled :class:`telegram.ext.Job`. When using :attr:`concurrent_updates` or the :attr:`job_queue`, :meth:`process_update` or :meth:`telegram.ext.Job.run` may re-create the old entry due to the asynchronous nature of these features. Please make sure that your program can avoid or handle such situations. .. seealso:: :wiki:`Storing Bot, User and Chat Related Data ` Args: message (:class:`telegram.Message`, optional): A message with either :attr:`~telegram.Message.migrate_from_chat_id` or :attr:`~telegram.Message.migrate_to_chat_id`. Mutually exclusive with passing :paramref:`old_chat_id` and :paramref:`new_chat_id`. .. seealso:: :attr:`telegram.ext.filters.StatusUpdate.MIGRATE` old_chat_id (:obj:`int`, optional): The old chat ID. Mutually exclusive with passing :paramref:`message` new_chat_id (:obj:`int`, optional): The new chat ID. Mutually exclusive with passing :paramref:`message` Raises: ValueError: Raised if the input is invalid. z/Message and chat_id pair are mutually exclusivez&chat_id pair or message must be passedNzvInvalid message instance. The message must have either `Message.migrate_from_chat_id` or `Message.migrate_to_chat_id`.z,old_chat_id and new_chat_id must be integers) ranymigrate_from_chat_idmigrate_to_chat_idchatrrr_r]rpr_r/)rKrurvrws rMmigrate_chat_datazApplication.migrate_chat_datasV  {NO OG[+67EF F ++38R8R8Z V "66I',,//K!44G K[#.:k33OKL L'+{'C $ K( 3377 DrN)rjobr~r;ct|trv|jr/|jj |jj |j r/|jj |j j |rd|jr%|jj |j|jr&|jj |jyyyrH) rreffective_chatr_r/reffective_userrgrmrr)rKrr~s rMrAz(Application._mark_for_persistence_update<s ff %$$;;??@U@U@X@XY$$;;??@U@U@X@XY {{;;?? L{{;;?? L rNchat_idsuser_idsc*|rGt|tr|jj|n|jj ||rHt|tr|j j|y|j j |yy)aMark entries of :attr:`chat_data` and :attr:`user_data` to be updated on the next run of :meth:`update_persistence`. Tip: Use this method sparingly. If you have to use this method, it likely means that you access and modify ``context.application.chat/user_data[some_id]`` within a callback. Note that for data which should be available globally in all handler callbacks independent of the chat/user, it is recommended to use :attr:`bot_data` instead. .. versionadded:: 20.3 Args: chat_ids (:obj:`int` | Collection[:obj:`int`], optional): Chat IDs to mark. user_ids (:obj:`int` | Collection[:obj:`int`], optional): User IDs to mark. N)rr_r_r/rrg)rKrrs rM mark_data_for_update_persistencez,Application.mark_data_for_update_persistenceKss& (C(;;??I;;BB8L (C(;;??I;;BB8L rNcK|jjs[|jsy tj|jj |jj d{yyy7#tj$rYnwxYw|jd{7|jjsRw)N)r) rr"rnrwait_forrupdate_interval TimeoutErrorrrs rMrz Application._persistence_updateris1188:## &&3388: ,,<<;''  ))+ + +%1188:sG(C AA;1A92A;6C 9A;;BC BC 'B*(C cK|j4d{|jd{dddd{y7-77 #1d{7swYyxYww)aUpdates :attr:`user_data`, :attr:`chat_data`, :attr:`bot_data` in :attr:`persistence` along with :attr:`~telegram.ext.ExtBot.callback_data_cache` and the conversation states of any persistent :class:`~telegram.ext.ConversationHandler` registered for this application. For :attr:`user_data` and :attr:`chat_data`, only those entries are updated which either were used or have been manually marked via :meth:`mark_data_for_update_persistence` since the last run of this method. Tip: This method will be called in regular intervals by the application. There is usually no need to call it manually. Note: Any data is deep copied with :func:`copy.deepcopy` before handing it over to the persistence in order to avoid race conditions, so all persisted data must be copyable. .. seealso:: :attr:`telegram.ext.BasePersistence.update_interval`, :meth:`mark_data_for_update_persistence` N)r _Application__update_persistencers rMrzApplication.update_persistencesV(11 . .++- - - . . . - . . . .sQAAAAAA AAAAAA A AAc vKjsytjdt}jjj rgj jQ|jjjtj jjjjjr=|jjjtjjjjrj}t_j }t_||z}|D]C}|jjj#|tj|E|D],}|jjj%|.jjj&rj(}t_j*}t_||z}|D]C}|jjj-|tj&|E|D],}|jjj/|.ddlm}t4j6j9dj:j=DD]\}\}} t?| |r| jAsbjBrtjdntjEd| jF} j:|jI|n| jK} n| } | tLjNurdn| } |jjjQ||| tSjT|dd id{} tjd tSjTfd | Dd{y7=7w) Nz.Starting next run of updating the persistence.r) PendingStatec3|K|]4\}}ttj||j6ywrH)ziprrepeatpop_accessed_write_items).0r states_dicts rM z3Application.__update_persistence..s9D !k    & (L(L(N OD s:<zA ConversationHandlers state was not yet resolved. Updating the persistence with the current state. Will check again on next run of Application.update_persistence.zcA ConversationHandlers state was not yet resolved. Updating the persistence with the current state.)rr new_staterTzFinished updating persistence.c3dK|]'}t|trj|d)ywr)rrr)rrrKs rMrz3Application.__update_persistence..s3fi0"""=s-0)+rnrrrrrrhrr/update_callback_datar persistence_datariupdate_bot_datarjr_r^update_chat_datarprtrgrfupdate_user_datartrrrrrr`rbrrrwarning old_statemark_as_accessedrr*DELETEDupdate_conversationrr) rK coroutines update_ids delete_idsrmrrrrrrreffective_new_stateresultss ` rM__update_persistencez Application.__update_persistences  FG%(U     & & 4 4 HH ( ( 4 NN  5544EE     & & / / NN4++;;HT]]>wGH I    & & 0 0DDJ:=%D 7DDJ:=%D 7 * $J% $$55gxW^H_?`a & It//>>wGH I L&/oo&C&CD %)%M%M%S%S%UD ' #  "D"3 )\2 !~~'|| >  B'00F<` Hint: This method currently has no influence on calls to :meth:`process_error` that are already in progress. .. warning:: This behavior should currently be considered an implementation detail and not as guaranteed behavior. .. seealso:: :wiki:`Exceptions, Warnings and Logging ` Args: callback (:term:`coroutine function`): The callback function for this error handler. Will be called when an error is raised. Callback signature:: async def callback(update: Optional[object], context: CallbackContext) The error that happened will be present in :attr:`telegram.ext.CallbackContext.error`. block (:obj:`bool`, optional): Determines whether the return value of the callback should be awaited before processing the next error handler in :meth:`process_error`. Defaults to :obj:`True`. zAThe callback is already registered as an error handler. Ignoring.N)rlrr)rKrrXs rMadd_error_handlerzApplication.add_error_handlers3J t** * OO_ ` (-H%rNc<|jj|dy)aRemoves an error handler. Hint: This method currently has no influence on calls to :meth:`process_error` that are already in progress. .. warning:: This behavior should currently be considered an implementation detail and not as guaranteed behavior. Args: callback (:term:`coroutine function`): The error handler to remove. N)rlro)rKrs rMremove_error_handlerz Application.remove_error_handler.s $/rNrzJob[CCT]c K|jrt|jj}|D]\}} |jjj |||||}|rX|turt|jtrk|jjrU|jjjs5|j||||dd|jj d  |||d{ytj%d |y#t $r#} tjd|| Yd} ~ yd} ~ wwxYw7N#t"$rYyt $r"} tj%d | Yd} ~ Od} ~ wwxYww) aProcesses an error by passing it to all error handlers registered with :meth:`add_error_handler`. If one of the error handlers raises :class:`telegram.ext.ApplicationHandlerStop`, the error will not be handled by other error handlers. Raising :class:`telegram.ext.ApplicationHandlerStop` also stops processing of the update when this method is called by :meth:`process_update`, i.e. no further handlers (even in other groups) will handle the update. All other exceptions raised by an error handler will just be logged. .. versionchanged:: 20.0 * ``dispatch_error`` was renamed to :meth:`process_error`. * Exceptions raised by error handlers are now properly logged. * :class:`telegram.ext.ApplicationHandlerStop` is no longer reraised but converted into the return value. Args: update (:obj:`object` | :class:`telegram.Update`): The update that caused the error. error (:obj:`Exception`): The error that was raised. job (:class:`telegram.ext.Job`, optional): The job that caused the error. .. versionadded:: 20.0 coroutine (:term:`coroutine function`, optional): The coroutine that caused the error. Returns: :obj:`bool`: :obj:`True`, if one of the error handlers raised :class:`telegram.ext.ApplicationHandlerStop`. :obj:`False`, otherwise. )rr applicationr~r)ziError while building CallbackContext for exception %s. Exception will not be processed by error handlers.rNFTrz:process_error:non_blocking)rr,rr>z4No error handlers are registered, logging exception.)rllistrbrkrT from_errorrrrrrrhr%rYrXr+rrDr:) rKrrr~r)error_handler_itemsrrXrTrs rMrzApplication.process_error?sD    #'t':':'@'@'B"C #6* %!"0088CC%#$("+ DG$\)"488V4)) HH--33&& 1%)-+DHHKK=8ST ' &vw777E* VP[`aK! !$$Q!$ %! !281$#$))H%(*sw8F *D!%BF 5 EEEF ! E *EF E  F E FF F&F=F FF )rFr:)rFr9)rFN)rr7rFN)TrH)NFN)NF)NNN)NN)erOrPrQrRr?r@rSr,rr'r/r#r1r.r+r$r-rrrrJr=rtyperr rstrrpropertyboolrr_rrxry staticmethodrrrrrrrrrrrdtm timedeltarfloatr rrrrrrrr r rr _CoroTyper0rTrr+rTaskr1r.rKrrGrOr<r&rd _DEFAULT_0r`rrirlrprtr}rArrrrrrr3rrr_ErrorCoroTyperrwrNrMr>r>vssl F #//7: G# DNO54O5O5. O5 '" O5  O50O5ob"bj9:O5$CRO4O5 <=ycSW?XX Y O5 <=ycSW?XX Y O5  <=ycSW?XX Y !O5bxH" 4 ./ -( '    B# B =C = = 8O4  && $ $ )+V %"N:3j@4D#N #+cmmB7!"37/30<m m m  m "(3-0 m 'tn m m x}-m  m b)&+/*.!"%)37/3$(!0<&*59!^ s ^ Sk^  ^ uS$Y'( ^ eCI& ' ^ ^ c]^ "(3-0^ 'tn^ SM^ ^ ^ x}-^ sm^ uS$012!^ " #^ @ s t  ?!$?!x}-?! ?!  ?!  ?!H$(&Q # &QR=&Q &Q sm &Q  &QV$(!&" R=   sm   < $(!& ,=R=,= ,= ,= ,=\<, 2*V** U=6U=dU=nMZG-;sC}#=G-cG-^bG-^0: 9 [c3/ 0 h{3S=9:: ; = 9 S,s++, 9 9xAN)"3S=1):=) )0AcAdA&AcAdA*(,%)%) @E)$@Ec]@Ec] @E  @EH-1 M!&) M7? M  M SWM S*M=Ec#h=OM M<,,..k `+).!&#t"34).d|).  ).V0_VS$=N-O0TX0*%)26 V VVj ! V N2./ V  VrN)orRrr6datetimerr~rrrr? collectionsrcollections.abcrrrrrrRr pathlibr typesr r typingr rrrrrrrtelegram._updatertelegram._utils.defaultvaluerrrrrtelegram._utils.loggingrtelegram._utils.reprrtelegram._utils.typesrrrr telegram._utils.warningsr!telegram.errorr"telegram.ext._basepersistencer#telegram.ext._contexttypesr$telegram.ext._extbotr%"telegram.ext._handlers.basehandlerr&telegram.ext._updaterr'telegram.ext._utils.networkloopr(telegram.ext._utils.stackr) telegram.ext._utils.trackingdictr*telegram.ext._utils.typesr+r,r-r.r/r0r1r2r3telegram.warningsr4r5telegramr6rr7r8 telegram.ext._applicationbuilderr9!telegram.ext._baseupdateprocessorr:telegram.ext._jobqueuer;r<r___annotations__r=rTrrr@rrrOrrrDAbstractAsyncContextManagerr>rwrNrMrsI&2 #NN1\\\#/?CC)(93':)>39ccc3 :GE* s :] 3x !_ w" Ii 8$ BCYr]RSI)B-( X -Y->_**=9 BRR #$_rN