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
This commit is contained in:
@@ -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"<b>✅ 导入完成</b>\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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user