From 020dc1c4a819809dad48d8dcf44fe93c8ffe6fe8 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 18 Mar 2024 20:48:24 +0800 Subject: [PATCH] :bookmark: Update to v1.4.13 --- pagermaid/__init__.py | 4 ++-- pagermaid/modules/reload.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pagermaid/__init__.py b/pagermaid/__init__.py index dd23d95..dea0767 100644 --- a/pagermaid/__init__.py +++ b/pagermaid/__init__.py @@ -22,8 +22,8 @@ from pagermaid.scheduler import scheduler import pyromod.listen from pyrogram import Client -pgm_version = "1.4.12" -pgm_version_code = 1412 +pgm_version = "1.4.13" +pgm_version_code = 1413 CMD_LIST = {} module_dir = __path__[0] working_dir = getcwd() diff --git a/pagermaid/modules/reload.py b/pagermaid/modules/reload.py index db07367..1fe33b7 100644 --- a/pagermaid/modules/reload.py +++ b/pagermaid/modules/reload.py @@ -28,7 +28,8 @@ async def clear_read_context_cron(): @scheduler.scheduled_job("interval", seconds=10, id="reload.ping_watchdog") async def ping_task(): - if not bot.is_initialized: + if not bot.session.is_started.is_set(): + logs.debug("Ping task bot not started, skip") return if ping_watchdog_event.is_set(): logs.debug("Ping task watchdog event set, skip") @@ -46,8 +47,7 @@ async def ping_task(): logs.debug("Ping task raise OSError, try restart") ping_watchdog_event.set() try: - await bot.restart() - await reload_all() + await bot.session.restart() finally: ping_watchdog_event.clear() logs.debug("Ping task ok")