From 7afe5f39bfdbdc0702b9a9b77df79372678afe26 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Mon, 9 Jan 2023 21:15:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BE=A4=E5=86=85=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=B8=8D=E5=9B=9E=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98=20(#94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/qqbot/manager.py | 1 - pkg/qqbot/process.py | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/qqbot/manager.py b/pkg/qqbot/manager.py index 261558ef..95dd382b 100644 --- a/pkg/qqbot/manager.py +++ b/pkg/qqbot/manager.py @@ -189,7 +189,6 @@ class QQBotManager: # 群消息处理 def on_group_message(self, event: GroupMessage): - reply = '' def process(text=None) -> str: diff --git a/pkg/qqbot/process.py b/pkg/qqbot/process.py index 40ea5db3..e2707ada 100644 --- a/pkg/qqbot/process.py +++ b/pkg/qqbot/process.py @@ -109,13 +109,13 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes logging.info("根据禁用列表忽略群{}的消息".format(launcher_id)) return [] - # 检查是否被禁言 - if launcher_type == 'group': - result = mgr.bot.member_info(target=launcher_id, member_id=mgr.bot.qq).get() - result = asyncio.run(result) - if result.mute_time_remaining > 0: - logging.info("机器人被禁言,跳过消息处理(group_{},剩余{}s)".format(launcher_id, - result.mute_time_remaining)) + # 检查是否被禁言 + if launcher_type == 'group': + result = mgr.bot.member_info(target=launcher_id, member_id=mgr.bot.qq).get() + result = asyncio.run(result) + if result.mute_time_remaining > 0: + logging.info("机器人被禁言,跳过消息处理(group_{},剩余{}s)".format(launcher_id, + result.mute_time_remaining)) return reply pkg.openai.session.get_session(session_name).acquire_response_lock()