fix: 群内消息不回复的问题 (#94)

This commit is contained in:
Rock Chin 2023-01-09 21:15:13 +08:00
parent 01bc529b93
commit 7afe5f39bf
2 changed files with 7 additions and 8 deletions

View File

@ -189,7 +189,6 @@ class QQBotManager:
# 群消息处理
def on_group_message(self, event: GroupMessage):
reply = ''
def process(text=None) -> str:

View File

@ -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()