腿来功能,查看文件路径

This commit is contained in:
liuwei
2025-03-10 10:34:12 +08:00
parent 8e4aafe9af
commit c8513da1aa

View File

@@ -24,7 +24,6 @@ class BeautyLeg:
self.command = config["command"]
self.LOG.info(f"[美腿] 组件初始化完成,指令: {self.command}")
import requests
def get_random_file_from_dir(self, directory):
image_extensions = {'.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.webp'}
@@ -71,6 +70,7 @@ class BeautyLeg:
# 使用示例
directory = 'beautyleg/download_dir' # 替换为你的目录路径
random_file_path = self.get_random_file_from_dir(directory)
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)
else: