From d165dce830b4ee7783d58d5f7419e7055a852166 Mon Sep 17 00:00:00 2001 From: "astrbot-docs-agent[bot]" Date: Mon, 2 Feb 2026 17:58:46 +0000 Subject: [PATCH] docs: update for AstrBotDevs/AstrBot#4650 --- en/dev/star/guides/plugin-config.md | 14 ++++++++++++-- zh/dev/star/guides/plugin-config.md | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/en/dev/star/guides/plugin-config.md b/en/dev/star/guides/plugin-config.md index 7354046..5646102 100644 --- a/en/dev/star/guides/plugin-config.md +++ b/en/dev/star/guides/plugin-config.md @@ -43,7 +43,7 @@ The file content is a `Schema` that represents the configuration. The Schema is } ``` -- `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. +- `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. - `description`: Optional. Description of the configuration. A one-sentence description of the configuration's behavior is recommended. - `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. - `obvious_hint`: Optional. Whether the configuration hint should be prominently displayed, like `token` in the image above. @@ -81,6 +81,16 @@ Introduced in v4.13.0, this allows plugins to define file-upload configuration i } ``` +### Palette Type + +Used for color selection. Supports three types: + +- `palette`: HEX format (e.g., `#FFFFFF`). +- `palette_rgb`: RGB format (e.g., `rgb(255, 255, 255)`). +- `palette_hsv`: HSV format (e.g., `hsv(0, 0%, 100%)`). + +In the WebUI, it will be presented as a color preview block and an input field. Clicking the preview block opens a color picker. + ### `dict` type schema Used to visualize editing a Python `dict` type configuration. For example, AstrBot Core's custom extra body parameter configuration: @@ -209,4 +219,4 @@ class ConfigPlugin(Star): ## Configuration Updates -When you update the Schema across different versions, AstrBot will recursively inspect the configuration items in the Schema, automatically adding default values for missing items and removing those that no longer exist. \ No newline at end of file +When you update the Schema across different versions, AstrBot will recursively inspect the configuration items in the Schema, automatically adding default values for missing items and removing those that no longer exist. diff --git a/zh/dev/star/guides/plugin-config.md b/zh/dev/star/guides/plugin-config.md index 18c2a8d..8af58ea 100644 --- a/zh/dev/star/guides/plugin-config.md +++ b/zh/dev/star/guides/plugin-config.md @@ -43,12 +43,12 @@ AstrBot 提供了”强大“的配置解析和可视化功能。能够让用户 } ``` -- `type`: **此项必填**。配置的类型。支持 `string`, `text`, `int`, `float`, `bool`, `object`, `list`, `dict`, `template_list`。当类型为 `text` 时,将会可视化为一个更大的可拖拽宽高的 textarea 组件,以适应大文本。 +- `type`: **此项必填**。配置的类型。支持 `string`, `text`, `int`, `float`, `bool`, `object`, `list`, `dict`, `template_list`, `file`, `palette`, `palette_rgb`, `palette_hsv`。当类型为 `text` 时,将会可视化为一个更大的可拖拽宽高的 textarea 组件,以适应大文本。 - `description`: 可选。配置的描述。建议一句话描述配置的行为。 - `hint`: 可选。配置的提示信息,表现在上图中右边的问号按钮,当鼠标悬浮在问号按钮上时显示。 - `obvious_hint`: 可选。配置的 hint 是否醒目显示。如上图的 `token`。 - `default`: 可选。配置的默认值。如果用户没有配置,将使用默认值。int 是 0,float 是 0.0,bool 是 False,string 是 "",object 是 {},list 是 []。 -- `items`: 可选。如果配置的类型是 `object`,需要添加 `items` 字段。`items` 的内容是这个配置项的子 Schema。理论上可以无限嵌套,但是不建议过多嵌套。 +- `items`: 可选。如果配置的类型是 `object`,需要添加 `items` 字段。`items` 的内容是 this 配置项的子 Schema。理论上可以无限嵌套,但是不建议过多嵌套。 - `invisible`: 可选。配置是否隐藏。默认是 `false`。如果设置为 `true`,则不会在管理面板上显示。 - `options`: 可选。一个列表,如 `"options": ["chat", "agent", "workflow"]`。提供下拉列表可选项。 - `editor_mode`: 可选。是否启用代码编辑器模式。需要 AstrBot >= `v3.5.10`, 低于这个版本不会报错,但不会生效。默认是 false。 @@ -81,6 +81,16 @@ AstrBot 提供了”强大“的配置解析和可视化功能。能够让用户 } ``` +### 调色板类型 (Palette) + +用于选择颜色。支持以下三种类型: + +- `palette`: HEX 格式(如 `#FFFFFF`)。 +- `palette_rgb`: RGB 格式(如 `rgb(255, 255, 255)`)。 +- `palette_hsv`: HSV 格式(如 `hsv(0, 0%, 100%)`)。 + +在 WebUI 中将呈现为一个颜色预览块和输入框,点击预览块可打开调色板进行选择。 + ### dict 类型的 schema 用于可视化编辑一个 Python 的 dict 类型的配置。如 AstrBot Core 中的自定义请求体参数配置项: