diff --git a/docs/en/dev/star/guides/storage.md b/docs/en/dev/star/guides/storage.md index 5e7c5cadf..286d2382b 100644 --- a/docs/en/dev/star/guides/storage.md +++ b/docs/en/dev/star/guides/storage.md @@ -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. ``` diff --git a/docs/zh/dev/star/guides/storage.md b/docs/zh/dev/star/guides/storage.md index 19f4ea8d0..a03ac2993 100644 --- a/docs/zh/dev/star/guides/storage.md +++ b/docs/zh/dev/star/guides/storage.md @@ -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 及以上版本可用,低于此版本请自行指定插件名称 ```