fix: 修复子字段值为空时导致字段丢失的问题

This commit is contained in:
Junyan Qin 2024-10-16 16:08:58 +08:00
parent a313ae5f97
commit 3db52282b8
No known key found for this signature in database
GPG Key ID: 8AC0BEFE1743A015
5 changed files with 56 additions and 31 deletions

View File

@ -8,16 +8,15 @@
"description": "以数组形式设置,程序将前缀符合设置的消息视为命令(群内需要符合群响应规则)",
"items": {
"type": "string"
}
},
"default": [
"!",
""
]
},
"privilege": {
"type": "object",
"title": "权限管理",
"layout": {
"props": {
"title": "权限管理"
}
},
"description": "设置每个命令的权限配置。普通用户权限级别为 1管理员system.json中设置的权限级别为 2在这里设置每个命令的最低权限级别若设置为1则用户和管理员均可用若为2则仅管理员可用设置子命令时以点号间隔如\"plugin.on\"",
"properties": {
"placeholder": {
@ -33,7 +32,8 @@
"minimum": 1,
"maximum": 2
}
}
},
"default": {}
}
}
}

View File

@ -13,7 +13,8 @@
"enum": [
"blacklist",
"whitelist"
]
],
"default": "blacklist"
},
"blacklist": {
"type": "array",
@ -23,7 +24,8 @@
"type": "string",
"format": "regex",
"pattern": "^(person|group)_(\\d)*$"
}
},
"default": []
},
"whitelist": {
"type": "array",
@ -33,7 +35,8 @@
"type": "string",
"format": "regex",
"pattern": "^(person|group)_(\\d)*$"
}
},
"default": []
}
},
"required": [
@ -65,7 +68,8 @@
"description": "带有指定前缀的消息即使没有 at 机器人也会被响应,发送给 AI 时会删除前缀",
"items": {
"type": "string"
}
},
"default": []
},
"regexp": {
"type": "array",
@ -74,7 +78,8 @@
"items": {
"type": "string",
"format": "regex"
}
},
"default": []
},
"random": {
"type": "number",
@ -113,7 +118,8 @@
"description": "带有指定前缀的消息即使没有 at 机器人也会被响应,发送给 AI 时会删除前缀",
"items": {
"type": "string"
}
},
"default": []
},
"regexp": {
"type": "array",
@ -122,7 +128,8 @@
"items": {
"type": "string",
"format": "regex"
}
},
"default": []
},
"random": {
"type": "number",
@ -164,7 +171,8 @@
"description": "具有指定前缀的消息将被忽略",
"items": {
"type": "string"
}
},
"default": []
},
"regexp": {
"type": "array",
@ -173,7 +181,8 @@
"items": {
"type": "string",
"format": "regex"
}
},
"default": []
}
}
},
@ -205,11 +214,13 @@
},
"api-key": {
"type": "string",
"title": "API Key"
"title": "API Key",
"default": ""
},
"api-secret": {
"type": "string",
"title": "API Secret"
"title": "API Secret",
"default": ""
}
}
},

View File

@ -5,6 +5,7 @@
"platform-adapters": {
"type": "array",
"title": "消息平台适配器",
"default": {},
"items": {
"type": "object",
"oneOf": [
@ -236,7 +237,8 @@
},
"font-path": {
"type": "string",
"description": "image的渲染字体。未设置时如果在windows下会尝试寻找系统的微软雅黑字体若找不到则转为forward策略。未设置时若不是windows系统则直接转为forward策略"
"description": "image的渲染字体。未设置时如果在windows下会尝试寻找系统的微软雅黑字体若找不到则转为forward策略。未设置时若不是windows系统则直接转为forward策略",
"default": ""
}
}
},

View File

@ -25,7 +25,8 @@
"description": "OpenAI API 密钥",
"items": {
"type": "string"
}
},
"default": []
},
"anthropic": {
"type": "array",
@ -33,7 +34,8 @@
"description": "Anthropic API 密钥",
"items": {
"type": "string"
}
},
"default": []
},
"moonshot": {
"type": "array",
@ -41,7 +43,8 @@
"description": "Moonshot API 密钥",
"items": {
"type": "string"
}
},
"default": []
},
"deepseek": {
"type": "array",
@ -49,7 +52,8 @@
"description": "DeepSeek API 密钥",
"items": {
"type": "string"
}
},
"default": []
}
}
},
@ -68,7 +72,8 @@
"title": "API URL"
},
"args": {
"type": "object"
"type": "object",
"default": {}
},
"timeout": {
"type": "number",
@ -87,7 +92,8 @@
"title": "API URL"
},
"args": {
"type": "object"
"type": "object",
"default": {}
},
"timeout": {
"type": "number",
@ -106,7 +112,8 @@
"title": "API URL"
},
"args": {
"type": "object"
"type": "object",
"default": {}
},
"timeout": {
"type": "number",
@ -125,7 +132,8 @@
"title": "API URL"
},
"args": {
"type": "object"
"type": "object",
"default": {}
},
"timeout": {
"type": "number",
@ -175,14 +183,16 @@
"default": {
"type": "string",
"title": "默认情景预设",
"description": "设置默认情景预设。值为空字符串时,将不使用情景预设(人格)"
"description": "设置默认情景预设。值为空字符串时,将不使用情景预设(人格)",
"default": ""
}
},
"patternProperties": {
"^.*$": {
"type": "string",
"title": "情景预设",
"description": "设置情景预设。值为空字符串时,将不使用情景预设(人格)"
"description": "设置情景预设。值为空字符串时,将不使用情景预设(人格)",
"default": ""
}
},
"required": ["default"]
@ -190,7 +200,8 @@
"runner": {
"type": "string",
"title": "请求运行器",
"description": "设置请求运行器。值为local-agent时使用内置默认运行器支持插件扩展"
"description": "设置请求运行器。值为local-agent时使用内置默认运行器支持插件扩展",
"default": "local-agent"
}
}
}

View File

@ -10,7 +10,8 @@
"type": "string",
"format": "regex",
"pattern": "^(person|group)_(\\d+)$"
}
},
"default": []
},
"network-proxies": {
"type": "object",