From 7f21781c0b20b3078b58ec215d1e451b5de87dc3 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 3 May 2023 12:33:01 +0800 Subject: [PATCH] Update tgclient.py --- plugins/tgclient/startup/tgclient.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/tgclient/startup/tgclient.py b/plugins/tgclient/startup/tgclient.py index 58f5c695e..933ba7170 100644 --- a/plugins/tgclient/startup/tgclient.py +++ b/plugins/tgclient/startup/tgclient.py @@ -99,7 +99,7 @@ while True: client = TelegramClient('mdioks', cfg['bot']['api_id'], cfg['bot']['api_hash']) -async def plugins_run(): +async def plugins_run_task(): plist = getStartExtCfgByTag('client') for p in plist: try: @@ -110,6 +110,11 @@ async def plugins_run(): writeLog(mw.getTracebackInfo()) writeLog('----- client error end -------') +async def plugins_run(): + while True: + await plugins_run_task() + time.sleep(1) + async def main(loop): await client.start()