From 0442ccc704b8e93cefec0243450058b98b6c5ae5 Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 10 Mar 2025 10:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=85=BF=E6=9D=A5=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beautyleg/beauty_leg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beautyleg/beauty_leg.py b/beautyleg/beauty_leg.py index a8934f4..fc31e45 100644 --- a/beautyleg/beauty_leg.py +++ b/beautyleg/beauty_leg.py @@ -24,7 +24,6 @@ class BeautyLeg: self.command = config["command"] self.LOG.info(f"[美腿] 组件初始化完成,指令: {self.command}") - def get_random_file_from_dir(self, directory): image_extensions = {'.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.webp'} image_files = [] @@ -70,8 +69,9 @@ class BeautyLeg: # 使用示例 directory = 'beautyleg/download_dir' # 替换为你的目录路径 random_file_path = self.get_random_file_from_dir(directory) + random_file_path = os.path.abspath(random_file_path) self.LOG.info(f"BeautyLeg.random_file_path: {random_file_path}") if random_file_path: - return self.wcf.send_file(os.path.abspath(random_file_path), message.roomid) + return self.wcf.send_file(random_file_path, message.roomid) else: return None