refactor: 完成MessageSource适配器解耦

This commit is contained in:
Rock Chin
2023-04-21 17:51:58 +08:00
parent 016391c976
commit 160086feb9
7 changed files with 185 additions and 150 deletions

View File

@@ -66,11 +66,8 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes
# 检查是否被禁言
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 mgr.adapter.is_muted(launcher_id):
logging.info("机器人被禁言,跳过消息处理(group_{})".format(launcher_id))
return reply
import config