加入验证判断逻辑,以为是true,结果是文本。导致所有群都收到了消息
This commit is contained in:
@@ -100,6 +100,14 @@ class GroupBotManager:
|
||||
else:
|
||||
return PermissionStatus.DISABLED
|
||||
|
||||
@staticmethod
|
||||
def check_permission(group_id, feature: Feature):
|
||||
"""检查某个功能是否启用,若未启用则返回提示信息"""
|
||||
status = GroupBotManager.get_group_permission(group_id, feature)
|
||||
if status == PermissionStatus.DISABLED:
|
||||
return f"该功能未启用,请开启 {feature.description}。"
|
||||
return None # 如果已启用,则返回 None,不做处理
|
||||
|
||||
@staticmethod
|
||||
def handle_command(group_id, command_str):
|
||||
"""统一处理群功能指令"""
|
||||
@@ -246,6 +254,7 @@ def simulate_commands():
|
||||
# 保存到 Redis
|
||||
GroupBotManager.save_to_redis()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# 执行模拟命令
|
||||
simulate_commands()
|
||||
|
||||
Reference in New Issue
Block a user