From 3f290b2e1ad277515242f2a5a35a98b62e05f9b6 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Mon, 18 Dec 2023 16:31:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=91=BD=E4=BB=A4=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E9=80=9A=E8=BF=87=E6=95=8F=E6=84=9F=E8=AF=8D?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/qqbot/process.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/qqbot/process.py b/pkg/qqbot/process.py index 5062c0fd..88eaf19e 100644 --- a/pkg/qqbot/process.py +++ b/pkg/qqbot/process.py @@ -83,7 +83,9 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes processing.append(session_name) try: + msg_type = '' if text_message.startswith('!') or text_message.startswith("!"): # 指令 + msg_type = 'command' # 触发插件事件 args = { 'launcher_type': launcher_type, @@ -110,6 +112,7 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes mgr, config, launcher_type, launcher_id, sender_id, is_admin(sender_id)) else: # 消息 + msg_type = 'message' # 限速丢弃检查 # print(ratelimit.__crt_minute_usage__[session_name]) if config['rate_limit_strategy'] == "drop": @@ -154,7 +157,9 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes "回复[{}]文字消息:{}".format(session_name, reply[0][:min(100, len(reply[0]))] + ( "..." if len(reply[0]) > 100 else ""))) - reply = [mgr.reply_filter.process(reply[0])] + if msg_type == 'message': + reply = [mgr.reply_filter.process(reply[0])] + reply = blob.check_text(reply[0]) else: logging.info("回复[{}]消息".format(session_name))