From 0ed1530b4049944f44554ba4711acb823a211854 Mon Sep 17 00:00:00 2001 From: yj <2077506045@qq.com> Date: 星期二, 26 八月 2025 10:37:23 +0800 Subject: [PATCH] 1.新增结束语判断;2.增加@客服后静默;3.增加判断群已静默后AI已回复也不发消息 --- main.py | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/main.py b/main.py index cba621f..e6b60b3 100644 --- a/main.py +++ b/main.py @@ -11,9 +11,11 @@ from config import settings from app.api.callback import router as callback_router from app.api.friend_ignore import router as friend_ignore_router +from app.api.message_aggregation import router as message_aggregation_router from app.models.database import create_tables from app.workers.message_worker import message_worker from app.services.contact_sync import contact_sync_service +from app.services.message_aggregator import message_aggregator @asynccontextmanager @@ -57,6 +59,13 @@ # 鍏抽棴鏃舵墽琛� logger.info("姝e湪鍏抽棴搴旂敤...") + # 鍋滄娑堟伅鑱氬悎鏈嶅姟 + try: + message_aggregator.stop() + logger.info("娑堟伅鑱氬悎鏈嶅姟宸插仠姝�") + except Exception as e: + logger.error(f"娑堟伅鑱氬悎鏈嶅姟鍋滄澶辫触: {str(e)}") + # 鍋滄娑堟伅宸ヤ綔杩涚▼ try: message_worker.stop() @@ -87,6 +96,7 @@ # 娉ㄥ唽璺敱 app.include_router(callback_router, prefix="/api/v1", tags=["鍥炶皟鎺ュ彛"]) app.include_router(friend_ignore_router, prefix="/api/v1", tags=["濂藉弸蹇界暐绠$悊"]) +app.include_router(message_aggregation_router, prefix="/api/v1/aggregation", tags=["娑堟伅鑱氬悎绠$悊"]) @app.get("/") -- Gitblit v1.9.1