fix:修复禁言插件找不到user_id仍然发送指令的问题

This commit is contained in:
SengokuCola
2025-07-05 01:18:50 +08:00
parent 81156bf403
commit 2e1ecb41b7

View File

@@ -369,10 +369,10 @@ class MuteCommand(BaseCommand):
# 获取用户ID
person_id = person_api.get_person_id_by_name(target)
user_id = person_api.get_person_value(person_id, "user_id")
if not user_id:
error_msg = f"未找到用户 {target} 的ID"
await self.send_text(f"❌ 找不到用户: {target}")
user_id = await person_api.get_person_value(person_id, "user_id")
if not user_id or user_id == "unknown":
error_msg = f"未找到用户 {target} 的ID请输入person_name进行禁言"
await self.send_text(f"❌ 找不到用户 {target} 的ID请输入person_name进行禁言而不是qq号或者昵称")
logger.error(f"{self.log_prefix} {error_msg}")
return False, error_msg