From 2ed70b4b9631815b839a28d9888ec65ae7ad3056 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 6 Mar 2023 16:39:27 +0800 Subject: [PATCH] Update tgbot.py --- plugins/tgbot/startup/tgbot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/tgbot/startup/tgbot.py b/plugins/tgbot/startup/tgbot.py index 1851f2213..907ea84ec 100644 --- a/plugins/tgbot/startup/tgbot.py +++ b/plugins/tgbot/startup/tgbot.py @@ -42,6 +42,13 @@ def writeConf(data): # start tgbot cfg = getConfigData() +while True: + cfg = getConfigData() + if 'bot' in cfg and 'app_token' in cfg['bot']: + if cfg['bot']['app_token'] != '' and cfg['bot']['app_token'] != 'app_token': + break + time.sleep(3) + bot = telebot.TeleBot(cfg['bot']['app_token'])