diff --git a/telegram_bot.py b/telegram_bot.py index 7cccbb3..b4ae9dd 100644 --- a/telegram_bot.py +++ b/telegram_bot.py @@ -319,23 +319,43 @@ class ProvisionerBot: await update.message.reply_text("📭 team.json 中没有账号") return + # 加载 tracker 以获取成员账号完成状态 + tracker = load_team_tracker() + tracker_teams = tracker.get("teams", {}) + lines = [f"📋 team.json 账号列表 (共 {len(TEAMS)} 个)\n"] - + + total_completed = 0 + total_accounts = 0 + for i, team in enumerate(TEAMS): email = team.get("owner_email", "") + team_name = team.get("name", "") has_token = "🔑" if team.get("auth_token") else "🔒" - authorized = "✅" if team.get("authorized") else "" needs_login = " [需登录]" if team.get("needs_login") else "" - - lines.append(f"{i}. {has_token} {email}{authorized}{needs_login}") - + + # 从 tracker 获取该 Team 的成员完成情况 + team_accounts = tracker_teams.get(team_name, []) + completed_count = sum(1 for acc in team_accounts if acc.get("status") == "completed") + account_count = len(team_accounts) + + total_completed += completed_count + total_accounts += account_count + + # 显示完成进度 + if account_count > 0: + progress = f" [{completed_count}/{account_count}]" + else: + progress = "" + + lines.append(f"{i}. {has_token} {email}{progress}{needs_login}") + # 统计 with_token = sum(1 for t in TEAMS if t.get("auth_token")) - authorized = sum(1 for t in TEAMS if t.get("authorized")) - + lines.append(f"\n📊 统计:") lines.append(f"有 Token: {with_token}/{len(TEAMS)}") - lines.append(f"已授权: {authorized}/{len(TEAMS)}") + lines.append(f"已完成: {total_completed}/{total_accounts}") # 消息太长时分段发送 text = "\n".join(lines)