加入权限判断

This commit is contained in:
liuwei
2025-04-09 14:49:27 +08:00
parent df51dc268e
commit 4d434dcb57
10 changed files with 27 additions and 14 deletions

View File

@@ -42,8 +42,9 @@ class BeautyLegPlugin(MessagePluginInterface):
def __init__(self):
super().__init__()
# 修改图片目录路径指向 resource/beauty_leg
self.image_folder = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
"beautyleg", "download_dir")
"resource", "beauty_leg")
def initialize(self, context: Dict[str, Any]) -> bool:
"""初始化插件"""
@@ -91,7 +92,7 @@ class BeautyLegPlugin(MessagePluginInterface):
return command in self._commands
@plugin_stats_decorator(plugin_name="美腿图片")
@plugin_points_cost(1, "美腿图片消耗积分")
@plugin_points_cost(1, "美腿图片消耗积分", Feature.BEAUTY_LEG)
def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
"""处理消息"""
content = str(message.get("content", "")).strip()