init: 消息问答助手 — 微信/QQ监控 + 本地知识库搜索 + GUI

This commit is contained in:
youpaishidifu
2026-07-24 19:36:14 +08:00
parent 552c2cb0c5
commit bdfc24a4c7
8 changed files with 666 additions and 1 deletions
+36
View File
@@ -0,0 +1,36 @@
"""消息问答助手 — 入口"""
import logging
import os
import sys
# 确保在项目目录
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# 配置日志
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(name)s] %(levelname)s: %(message)s",
datefmt="%H:%M:%S",
)
logger = logging.getLogger("msgbot")
def main():
logger.info("消息问答助手启动中...")
# 动态导入 gui,避免 customtkinter 等缺失导致整个程序崩溃前无日志
try:
from gui import MsgBotApp
except ImportError as e:
logger.error(f"导入 GUI 失败: {e}")
logger.error("请先安装依赖: pip install -r requirements.txt")
sys.exit(1)
app = MsgBotApp()
app.mainloop()
if __name__ == "__main__":
main()