diff --git a/robot_cmd/robot_command.py b/robot_cmd/robot_command.py index b1c49b5..a940643 100644 --- a/robot_cmd/robot_command.py +++ b/robot_cmd/robot_command.py @@ -56,6 +56,17 @@ class GroupBotManager: "group_list": set() # 用于缓存 group:list } + @staticmethod + def display_menu_status(group_id): + """显示所有功能列表及其在指定群组中的当前状态,带emoji""" + menu = [] + for feature in Feature: + status = GroupBotManager.get_group_permission(group_id, feature) + status_emoji = "✅" if status == PermissionStatus.ENABLED else "❌" + status_str = "启用" if status == PermissionStatus.ENABLED else "关闭" + menu.append(f"{status_emoji} {status_str}-{feature.value}-{feature.description}") + return "\n".join(menu) + @staticmethod def load_local_cache(): """从 Redis 加载数据到本地缓存""" @@ -126,6 +137,10 @@ class GroupBotManager: if command_str.strip().upper() == "MENU": return GroupBotManager.display_menu() + # 如果是MENU-STATUS指令,返回功能列表及其状态 + if command_str.strip().upper() == "MENU-STATUS": + return GroupBotManager.display_menu_status(group_id) + # 如果是GROUP_LIST指令,返回 group:list 清单 if command_str.strip().upper() == "GROUP_LIST": return GroupBotManager.get_group_list()