doc: add file-typed config field get data api

This commit is contained in:
Junyan Qin
2025-11-06 00:15:05 +08:00
parent 2bde080abd
commit 09e1fcc5dc
2 changed files with 26 additions and 2 deletions
+13 -1
View File
@@ -297,4 +297,16 @@ async def delete_workspace_storage(self, key: str) -> None:
# Usage example
await self.plugin.delete_workspace_storage("key")
```
```
### Get Plugin File-typed Config Field Data
```python
async def get_config_file(self, file_key: str) -> bytes:
"""Get a config file value"""
# Usage example
file_bytes = await self.plugin.get_config_file("key")
```
Use this in conjunction with configuration fields of type [`file` or `array[file`](/en/plugin/dev/basic-info.html#type-file).
+13 -1
View File
@@ -297,4 +297,16 @@ async def delete_workspace_storage(self, key: str) -> None:
# 调用示例
await self.plugin.delete_workspace_storage("key")
```
```
### 获取插件配置项文件数据
```python
async def get_config_file(self, file_key: str) -> bytes:
"""Get a config file value"""
# 调用示例
file_bytes = await self.plugin.get_config_file("key")
```
请结合 [`file` 或 `array[file]` 类型配置项](/zh/plugin/dev/basic-info.html#type-file)使用。