refactor(maizone_refactored): use absolute path for default image directory

The default path for `image_directory` was previously a relative path (`./data/images`), which could lead to issues depending on the working directory from which the application is run.

This change modifies the default value to be an absolute path derived from the plugin's file location (`Path(__file__).parent / "images"`). This ensures that the image directory path is always correct and robust, regardless of the execution context.
This commit is contained in:
tt-P607
2025-08-21 00:05:05 +08:00
parent e59a939161
commit 6c64a0e8d3

View File

@@ -51,7 +51,7 @@ class MaiZoneRefactoredPlugin(BasePlugin):
"enable_reply": ConfigField(type=bool, default=True, description="完成后是否回复"),
"ai_image_number": ConfigField(type=int, default=1, description="AI生成图片数量"),
"image_number": ConfigField(type=int, default=1, description="本地配图数量1-9张"),
"image_directory": ConfigField(type=str, default="./data/images", description="图片存储目录")
"image_directory": ConfigField(type=str, default=str(Path(__file__).parent / "images"), description="图片存储目录")
},
"read": {
"permission": ConfigField(type=list, default=[], description="阅读权限QQ号列表"),