retry telegram connection forever

This commit is contained in:
Alex Tau 2025-05-31 18:48:23 +03:00
parent 2488cf6b07
commit 5d2759c63c

View file

@ -17,7 +17,7 @@ class Alert:
async def get_client() -> TelegramClient: async def get_client() -> TelegramClient:
config = cvars.config.get() config = cvars.config.get()
api_id, api_hash, bot_token = config.telegram.creds.split(",") api_id, api_hash, bot_token = config.telegram.creds.split(",")
client = await TelegramClient(MemorySession(), api_id, api_hash).start(bot_token=bot_token) client = await TelegramClient(MemorySession(), api_id, api_hash, connection_retries=None).start(bot_token=bot_token)
client.parse_mode = "html" client.parse_mode = "html"
return client return client