diff --git a/plugins/tgbot/startup/extend/push_ad.py b/plugins/tgbot/startup/extend/push_ad.py index 97a660cbf..d0c0d7f52 100644 --- a/plugins/tgbot/startup/extend/push_ad.py +++ b/plugins/tgbot/startup/extend/push_ad.py @@ -9,8 +9,12 @@ import json import base64 import threading -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw import telebot from telebot import types diff --git a/plugins/tgbot/startup/extend/push_bbs_ntid.py b/plugins/tgbot/startup/extend/push_bbs_ntid.py index 4a49ba3ab..88411fe38 100644 --- a/plugins/tgbot/startup/extend/push_bbs_ntid.py +++ b/plugins/tgbot/startup/extend/push_bbs_ntid.py @@ -9,8 +9,12 @@ import json import base64 import threading -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw import telebot from telebot import types diff --git a/plugins/tgbot/startup/extend/push_notice_msg.py b/plugins/tgbot/startup/extend/push_notice_msg.py index 0fea5ff39..bf39fd2e4 100644 --- a/plugins/tgbot/startup/extend/push_notice_msg.py +++ b/plugins/tgbot/startup/extend/push_notice_msg.py @@ -9,8 +9,12 @@ import json import base64 import threading -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw import telebot from telebot import types diff --git a/plugins/tgbot/startup/extend/receive_faq.py b/plugins/tgbot/startup/extend/receive_faq.py index 175090e17..cbb1a2760 100644 --- a/plugins/tgbot/startup/extend/receive_faq.py +++ b/plugins/tgbot/startup/extend/receive_faq.py @@ -7,8 +7,12 @@ import json import base64 import threading -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw import telebot from telebot import types diff --git a/plugins/tgbot/startup/extend/receive_music163_search.py b/plugins/tgbot/startup/extend/receive_music163_search.py index 8ba6b8000..f3a872021 100644 --- a/plugins/tgbot/startup/extend/receive_music163_search.py +++ b/plugins/tgbot/startup/extend/receive_music163_search.py @@ -9,6 +9,12 @@ import json import base64 import threading +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw import telebot from telebot import types diff --git a/plugins/tgbot/startup/tgbot.py b/plugins/tgbot/startup/tgbot.py index 75fc6d1ef..60b4a5546 100644 --- a/plugins/tgbot/startup/tgbot.py +++ b/plugins/tgbot/startup/tgbot.py @@ -9,8 +9,12 @@ import json import base64 import threading -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw import telebot diff --git a/plugins/tgbot/startup/tgpush.py b/plugins/tgbot/startup/tgpush.py index fcf34a811..57e2cd6f4 100644 --- a/plugins/tgbot/startup/tgpush.py +++ b/plugins/tgbot/startup/tgpush.py @@ -9,8 +9,12 @@ import json import base64 import threading -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw import telebot