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

Commit 658193e

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

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

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

Lines changed: 19 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.
@@ -66,6 +66,24 @@ The **_special** field is only available after v4.0.0. Currently supports `selec
6666

6767
![image](/source/images/plugin/image-select-provider.png)
6868

69+
### `palette` type schema
70+
71+
Introduced in v4.15.0, this allows plugins to define color selection configuration items.
72+
73+
- `palette`: Returns a HEX format color string, e.g., `#FFFFFF`.
74+
- `palette_rgb`: Returns an RGB format color string, e.g., `rgb(255, 255, 255)`.
75+
- `palette_hsv`: Returns an HSV format color string, e.g., `hsv(0, 0%, 100%)`.
76+
77+
```json
78+
{
79+
"theme_color": {
80+
"type": "palette",
81+
"description": "Theme Color",
82+
"default": "#FFFFFF"
83+
}
84+
}
85+
```
86+
6987
### `file` type schema
7088

7189
Introduced in v4.13.0, this allows plugins to define file-upload configuration items to guide users to upload files required by the plugin.

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ 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`, `palette`, `palette_rgb`, `palette_hsv`。当类型为 `text` 时,将会可视化为一个更大的可拖拽宽高的 textarea 组件,以适应大文本。
4747
- `description`: 可选。配置的描述。建议一句话描述配置的行为。
4848
- `hint`: 可选。配置的提示信息,表现在上图中右边的问号按钮,当鼠标悬浮在问号按钮上时显示。
4949
- `obvious_hint`: 可选。配置的 hint 是否醒目显示。如上图的 `token`
@@ -66,6 +66,24 @@ AstrBot 提供了”强大“的配置解析和可视化功能。能够让用户
6666

6767
![image](/source/images/plugin/image-select-provider.png)
6868

69+
### palette 类型的 schema
70+
71+
在 v4.15.0 之后引入,允许插件定义颜色选择配置项,引导用户选择颜色。
72+
73+
- `palette`: 返回 HEX 格式的颜色字符串,如 `#FFFFFF`
74+
- `palette_rgb`: 返回 RGB 格式的颜色字符串,如 `rgb(255, 255, 255)`
75+
- `palette_hsv`: 返回 HSV 格式的颜色字符串,如 `hsv(0, 0%, 100%)`
76+
77+
```json
78+
{
79+
"theme_color": {
80+
"type": "palette",
81+
"description": "主题颜色",
82+
"default": "#FFFFFF"
83+
}
84+
}
85+
```
86+
6987
### file 类型的 schema
7088

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

0 commit comments

Comments
 (0)