feature:全球政治经济新闻

This commit is contained in:
liuwei
2025-04-14 16:02:00 +08:00
parent bfdb1831d3
commit 8afd0f49d0
8 changed files with 885 additions and 220 deletions

View File

@@ -43,7 +43,8 @@ class Feature(Enum):
GROUP_ADD = 16, "加群提醒功能"
DOUYIN_PARSER = 17, "抖音链接转视频功能"
GROUP_MEMBER_CHANGE = 18, "群成员变更提醒功能"
KID_PHOTO_EXTRACT =19, "儿童照片提取转发功能" # 小朋友照片提取功能
KID_PHOTO_EXTRACT = 19, "儿童照片提取转发功能" # 小朋友照片提取功能
NEWS = 20, "全球政治经济新闻"
def __new__(cls, value, description):
obj = object.__new__(cls)
@@ -240,11 +241,11 @@ class GroupBotManager:
str: 格式化的已启用功能列表字符串
"""
enabled_features = []
# 检查群是否在列表中
if group_id not in GroupBotManager.local_cache["group_list"]:
return "该群未启用机器人功能"
# 遍历所有功能,检查哪些已启用且包含指令
for feature in Feature:
status = GroupBotManager.get_group_permission(group_id, feature)
@@ -255,18 +256,18 @@ class GroupBotManager:
"name": feature.name,
"description": feature.description
})
# 如果没有启用任何带指令的功能
if not enabled_features:
return "该群未启用任何带指令的功能"
# 构建格式化的字符串
result = f"群功能菜单:\n"
for feature in enabled_features:
result += f"{feature['id']}.{feature['description']}\n"
return result
@staticmethod
def get_group_list():
"""返回所有启用了群机器人的群组清单,格式为集合"""