From c94090c4b50d24ff26c502e0f9b0073959567c9f Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Tue, 10 Jun 2025 03:25:54 +0300 Subject: [PATCH] update _on_disconnect method in TelegramClient: change to async for better handling of disconnections --- telegram_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram_client.py b/telegram_client.py index be02181..21f24a1 100644 --- a/telegram_client.py +++ b/telegram_client.py @@ -49,7 +49,7 @@ class TelegramClient: self.client.add_handler(DisconnectHandler(self._on_disconnect)) logger.info("connection_handlers: connection handlers set up") - def _on_disconnect(self, _client): + async def _on_disconnect(self, _client): """Handles disconnection from Telegram servers""" self.disconnect_count += 1 logger.warning(f"connection_handler: connection lost (#{self.disconnect_count})")