docs: fix path concatenation error in storage.md (#7448)

* docs: 修复 storage.md 中路径拼接的错误示例

get_astrbot_data_path() 返回的是 str 类型,直接使用 / 运算符会导致 TypeError。修改文档示例,添加 Path() 包裹

* docs: 修复 storage.md 中路径拼接的错误示例

get_astrbot_data_path() 返回的是 str 类型,直接使用 / 运算符会导致 TypeError。修改文档示例,添加 Path() 包裹。
This commit is contained in:
2doright
2026-04-10 18:41:54 +08:00
committed by GitHub
parent 16f57dd971
commit 574e5089ba
2 changed files with 4 additions and 2 deletions

View File

@@ -25,7 +25,8 @@ To keep large file handling consistent, store large files under `data/plugin_dat
You can fetch the plugin data directory with:
```py
from pathlib import Path
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
plugin_data_path = get_astrbot_data_path() / "plugin_data" / self.name # self.name is the plugin name; available in v4.9.2 and above. For lower versions, specify the plugin name yourself.
plugin_data_path = Path(get_astrbot_data_path()) / "plugin_data" / self.name # self.name is the plugin name; available in v4.9.2 and above. For lower versions, specify the plugin name yourself.
```

View File

@@ -25,7 +25,8 @@ class Main(star.Star):
你可以通过以下代码获取插件数据目录:
```py
from pathlib import Path
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
plugin_data_path = get_astrbot_data_path() / "plugin_data" / self.name # self.name 为插件名称,在 v4.9.2 及以上版本可用,低于此版本请自行指定插件名称
plugin_data_path = Path(get_astrbot_data_path()) / "plugin_data" / self.name # self.name 为插件名称,在 v4.9.2 及以上版本可用,低于此版本请自行指定插件名称
```