Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit ac97681

Browse files
author
astrbot-docs-agent[bot]
committed
docs: update for AstrBotDevs/AstrBot#4650
1 parent e9aa976 commit ac97681

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

en/dev/star/guides/plugin-config.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The file content is a `Schema` that represents the configuration. The Schema is
4343
}
4444
```
4545

46-
- `type`: **Required**. The type of the configuration. Supports `string`, `text`, `int`, `float`, `bool`, `object`, `list`, `dict`, `template_list`, `file`. When the type is `text`, it will be visualized as a larger resizable textarea component to accommodate large text.
46+
- `type`: **Required**. The type of the configuration. Supports `string`, `text`, `int`, `float`, `bool`, `object`, `list`, `dict`, `template_list`, `file`, `palette`, `palette_rgb`, `palette_hsv`. When the type is `text`, it will be visualized as a larger resizable textarea component to accommodate large text.
4747
- `description`: Optional. Description of the configuration. A one-sentence description of the configuration's behavior is recommended.
4848
- `hint`: Optional. Hint information for the configuration, displayed in the question mark button on the right in the image above, shown when hovering over it.
4949
- `obvious_hint`: Optional. Whether the configuration hint should be prominently displayed, like `token` in the image above.
@@ -81,6 +81,25 @@ Introduced in v4.13.0, this allows plugins to define file-upload configuration i
8181
}
8282
```
8383

84+
### `palette` type schema
85+
86+
Introduced in v4.15.0, this allows plugins to define color selection configuration items, providing a visual color picker.
87+
88+
Three types are supported:
89+
- `palette`: Returns HEX format (e.g., `#FFFFFF`).
90+
- `palette_rgb`: Returns RGB format (e.g., `rgb(255, 255, 255)`).
91+
- `palette_hsv`: Returns HSV format (e.g., `hsv(0, 0%, 100%)`).
92+
93+
```json
94+
{
95+
"theme_color": {
96+
"type": "palette",
97+
"description": "Theme Color",
98+
"default": "#6200EE"
99+
}
100+
}
101+
```
102+
84103
### `dict` type schema
85104

86105
Used to visualize editing a Python `dict` type configuration. For example, AstrBot Core's custom extra body parameter configuration:

zh/dev/star/guides/plugin-config.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ AstrBot 提供了”强大“的配置解析和可视化功能。能够让用户
4343
}
4444
```
4545

46-
- `type`: **此项必填**。配置的类型。支持 `string`, `text`, `int`, `float`, `bool`, `object`, `list`, `dict`, `template_list`。当类型为 `text` 时,将会可视化为一个更大的可拖拽宽高的 textarea 组件,以适应大文本。
46+
- `type`: **此项必填**。配置的类型。支持 `string`, `text`, `int`, `float`, `bool`, `object`, `list`, `dict`, `template_list`, `file`, `palette`, `palette_rgb`, `palette_hsv`。当类型为 `text` 时,将会可视化为一个更大的可拖拽宽高的 textarea 组件,以适应大文本。
4747
- `description`: 可选。配置的描述。建议一句话描述配置的行为。
4848
- `hint`: 可选。配置的提示信息,表现在上图中右边的问号按钮,当鼠标悬浮在问号按钮上时显示。
4949
- `obvious_hint`: 可选。配置的 hint 是否醒目显示。如上图的 `token`
5050
- `default`: 可选。配置的默认值。如果用户没有配置,将使用默认值。int 是 0,float 是 0.0,bool 是 False,string 是 "",object 是 {},list 是 []
5151
- `items`: 可选。如果配置的类型是 `object`,需要添加 `items` 字段。`items` 的内容是这个配置项的子 Schema。理论上可以无限嵌套,但是不建议过多嵌套。
5252
- `invisible`: 可选。配置是否隐藏。默认是 `false`。如果设置为 `true`,则不会在管理面板上显示。
5353
- `options`: 可选。一个列表,如 `"options": ["chat", "agent", "workflow"]`。提供下拉列表可选项。
54-
- `editor_mode`: 可选。是否启用代码编辑器模式。需要 AstrBot >= `v3.5.10`, 低于这个版本不会报错,但不会生效。默认是 false。
54+
- `editor_mode`: 可选。是否启用代码编辑器模式。需要 AstrBot >= `v3.5.10`, 低于这个版本不会报错,但不会生效。默认 is false。
5555
- `editor_language`: 可选。代码编辑器的代码语言,默认为 `json`
5656
- `editor_theme`: 可选。代码编辑器的主题,可选值有 `vs-light`(默认), `vs-dark`
5757
- `_special`: 可选。用于调用 AstrBot 提供的可视化提供商选取、人格选取、知识库选取等功能,详见下文。
@@ -68,7 +68,7 @@ AstrBot 提供了”强大“的配置解析和可视化功能。能够让用户
6868

6969
### file 类型的 schema
7070

71-
在 v4.13.0 之后引入,允许插件定义文件上传配置项,引导用户上传插件所需的文件。
71+
在 v4.13.0 之后引入,允许插件定义 file 上传配置项,引导用户上传插件所需的文件。
7272

7373
```json
7474
{
@@ -81,6 +81,25 @@ AstrBot 提供了”强大“的配置解析和可视化功能。能够让用户
8181
}
8282
```
8383

84+
### palette 类型的 schema
85+
86+
在 v4.15.0 之后引入,允许插件定义颜色选择配置项,提供可视化的调色板。
87+
88+
支持三种类型:
89+
- `palette`: 返回 HEX 格式(如 `#FFFFFF`)。
90+
- `palette_rgb`: 返回 RGB 格式(如 `rgb(255, 255, 255)`)。
91+
- `palette_hsv`: 返回 HSV 格式(如 `hsv(0, 0%, 100%)`)。
92+
93+
```json
94+
{
95+
"theme_color": {
96+
"type": "palette",
97+
"description": "主题颜色",
98+
"default": "#6200EE"
99+
}
100+
}
101+
```
102+
84103
### dict 类型的 schema
85104

86105
用于可视化编辑一个 Python 的 dict 类型的配置。如 AstrBot Core 中的自定义请求体参数配置项:

0 commit comments

Comments
 (0)