From 987a2d2fb3c816f2e1a56b5b52257791c2d26cad Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Sun, 1 Jan 2023 19:19:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=81=E8=81=8A=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=20#74?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/qqbot/process.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/qqbot/process.py b/pkg/qqbot/process.py index c82b9324..16a4ced9 100644 --- a/pkg/qqbot/process.py +++ b/pkg/qqbot/process.py @@ -29,12 +29,13 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes session_name = "{}_{}".format(launcher_type, launcher_id) # 检查是否被禁言 - 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 + 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()