加入验证判断逻辑,以为是true,结果是文本。导致所有群都收到了消息

This commit is contained in:
liuwei
2025-02-17 15:39:38 +08:00
parent dc5be6c728
commit f8c73659f2
2 changed files with 7 additions and 2 deletions

View File

@@ -150,14 +150,14 @@ class GroupBotManager:
GroupBotManager.local_cache["group_list"].add(group_id)
# 同步到 Redis
r.sadd("group:list", group_id)
return f"群机器人已启用,群组 {group_id} 已加入 group:list"
return f"ROT已启用,群组 {group_id} 已加入"
elif action == "关闭":
GroupBotManager.set_group_permission(group_id, feature, PermissionStatus.DISABLED)
# 关闭群机器人时,从 group:list 中删除 group_id
GroupBotManager.local_cache["group_list"].remove(group_id)
# 同步到 Redis
r.srem("group:list", group_id)
return f"群机器人已关闭,群组 {group_id}从 group:list 移除"
return f"ROT已关闭,群组 {group_id} 已移除"
else:
return "无效操作,仅支持启用或关闭"