diff --git a/konabot/plugins/tqszm/__init__.py b/konabot/plugins/tqszm/__init__.py index 8bc7cbd..9d7e643 100644 --- a/konabot/plugins/tqszm/__init__.py +++ b/konabot/plugins/tqszm/__init__.py @@ -6,6 +6,7 @@ import functools +from loguru import logger from nonebot import on_message from nonebot.rule import KeywordsRule, Rule, ToMeRule from nonebot.adapters.onebot.v11.bot import Bot as OBBot @@ -16,6 +17,7 @@ from nonebot_plugin_alconna.uniseg.adapters.onebot11.builder import Onebot11Mess from pypinyin import pinyin, Style as PinyinStyle from konabot.common.longtask import DepLongTaskTarget +from konabot.common.apis.ali_content_safety import AlibabaGreen keywords = ("szmtq", "tqszm", "提取首字母", "首字母提取", ) @@ -62,5 +64,8 @@ async def _(target: DepLongTaskTarget, msg: UniMsg, evt: OBMessageEvent | None = p[0] for p in result if len(p) > 0 ], "") + if not await AlibabaGreen.detect(result_text): + logger.info(f"对首字母序列的检测未通过安全测试 RAW={texts} FORMATTED={result_text}") + await target.send_message(result_text, at=False)