mirror of
https://github.com/MrFadiAi/openclaw-manager.git
synced 2026-08-14 00:57:59 +00:00
feat: Implement configuration management commands for AI providers, gateway tokens, and environment variables.
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
"apiKey": "3e911333b0dc462dba0b4ce886303cce.4WF3QN7zfirCWXxS",
|
||||
"models": [
|
||||
{
|
||||
"id": "glm-4",
|
||||
"name": "GLM-4",
|
||||
"id": "glm-5",
|
||||
"name": "GLM-5",
|
||||
"api": "openai-completions",
|
||||
"reasoning": false,
|
||||
"input": [
|
||||
@@ -43,4 +43,4 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1855,14 +1855,24 @@ pub async fn save_telegram_account(account: TelegramAccount) -> Result<String, S
|
||||
if let Some(top_token) = config["channels"]["telegram"].get("botToken").and_then(|v| v.as_str()).map(|s| s.to_string()) {
|
||||
if !top_token.is_empty() {
|
||||
// Move existing single-bot config to accounts["default"]
|
||||
let existing = json!({
|
||||
let mut existing = json!({
|
||||
"botToken": top_token,
|
||||
"groupPolicy": config["channels"]["telegram"].get("groupPolicy").cloned().unwrap_or(json!(null)),
|
||||
"dmPolicy": config["channels"]["telegram"].get("dmPolicy").cloned().unwrap_or(json!(null)),
|
||||
"streamMode": config["channels"]["telegram"].get("streamMode").cloned().unwrap_or(json!(null)),
|
||||
"groups": config["channels"]["telegram"].get("groups").cloned().unwrap_or(json!(null)),
|
||||
});
|
||||
|
||||
// Migrate allowList
|
||||
if let Some(allow_from) = config["channels"]["telegram"].get("allowFrom").cloned() {
|
||||
existing["allowFrom"] = allow_from;
|
||||
}
|
||||
if let Some(group_allow_from) = config["channels"]["telegram"].get("groupAllowFrom").cloned() {
|
||||
existing["groupAllowFrom"] = group_allow_from;
|
||||
}
|
||||
|
||||
config["channels"]["telegram"]["accounts"]["default"] = existing;
|
||||
|
||||
// Remove top-level single-bot fields
|
||||
if let Some(tg) = config["channels"]["telegram"].as_object_mut() {
|
||||
tg.remove("botToken");
|
||||
|
||||
Reference in New Issue
Block a user