mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-20 11:26:07 +00:00
fix: 群内消息不回复的问题 (#94)
This commit is contained in:
@@ -189,7 +189,6 @@ class QQBotManager:
|
|||||||
|
|
||||||
# 群消息处理
|
# 群消息处理
|
||||||
def on_group_message(self, event: GroupMessage):
|
def on_group_message(self, event: GroupMessage):
|
||||||
|
|
||||||
reply = ''
|
reply = ''
|
||||||
|
|
||||||
def process(text=None) -> str:
|
def process(text=None) -> str:
|
||||||
|
|||||||
@@ -109,13 +109,13 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes
|
|||||||
logging.info("根据禁用列表忽略群{}的消息".format(launcher_id))
|
logging.info("根据禁用列表忽略群{}的消息".format(launcher_id))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# 检查是否被禁言
|
# 检查是否被禁言
|
||||||
if launcher_type == 'group':
|
if launcher_type == 'group':
|
||||||
result = mgr.bot.member_info(target=launcher_id, member_id=mgr.bot.qq).get()
|
result = mgr.bot.member_info(target=launcher_id, member_id=mgr.bot.qq).get()
|
||||||
result = asyncio.run(result)
|
result = asyncio.run(result)
|
||||||
if result.mute_time_remaining > 0:
|
if result.mute_time_remaining > 0:
|
||||||
logging.info("机器人被禁言,跳过消息处理(group_{},剩余{}s)".format(launcher_id,
|
logging.info("机器人被禁言,跳过消息处理(group_{},剩余{}s)".format(launcher_id,
|
||||||
result.mute_time_remaining))
|
result.mute_time_remaining))
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
pkg.openai.session.get_session(session_name).acquire_response_lock()
|
pkg.openai.session.get_session(session_name).acquire_response_lock()
|
||||||
|
|||||||
Reference in New Issue
Block a user