From 5de0a1a0530e3b744a75cefaf87e1f12e9bb41a6 Mon Sep 17 00:00:00 2001 From: kyx236 Date: Sun, 18 Jan 2026 17:45:21 +0800 Subject: [PATCH] feat(telegram_bot): Auto-reload config after account import to sync memory state - Add automatic config reload after importing accounts to team.json - Prevent save_team_json() from overwriting newly imported data by syncing memory state - Update user feedback message to indicate config is auto-refreshed instead of requiring manual /reload command - Improve user experience by eliminating extra step after account import --- telegram_bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telegram_bot.py b/telegram_bot.py index 3b53e6c..58bc83b 100644 --- a/telegram_bot.py +++ b/telegram_bot.py @@ -1398,13 +1398,16 @@ class ProvisionerBot: file_status = "📄 已创建 team.json" if is_new_file else "📄 已更新 team.json" + # 自动重载配置,同步内存状态,避免 save_team_json() 覆盖新导入的数据 + reload_result = reload_config() + await update.message.reply_text( f"✅ 导入完成\n\n" f"{file_status}\n" f"新增: {added}\n" f"跳过 (重复): {skipped}\n" f"team.json 总数: {len(existing_accounts)}\n\n" - f"💡 使用 /reload 刷新配置\n" + f"✅ 配置已自动刷新\n" f"使用 /run_all 或 /run <n> 开始处理", parse_mode="HTML" )