调整美腿功能
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
[Beautyleg]
|
[Beautyleg]
|
||||||
enable = true
|
enable = true
|
||||||
|
image_folder = '/mnt/nfs_share/beauty_leg'
|
||||||
command = ["美腿", "腿来"]
|
command = ["美腿", "腿来"]
|
||||||
command-format = """
|
command-format = """
|
||||||
🦵美腿图片指令:
|
🦵美腿图片指令:
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import os
|
|||||||
import random
|
import random
|
||||||
from typing import Dict, Any, List, Optional, Tuple
|
from typing import Dict, Any, List, Optional, Tuple
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from plugin_common.message_plugin_interface import MessagePluginInterface
|
from plugin_common.message_plugin_interface import MessagePluginInterface
|
||||||
from plugin_common.plugin_interface import PluginStatus
|
from plugin_common.plugin_interface import PluginStatus
|
||||||
from utils.decorator.plugin_decorators import plugin_stats_decorator
|
from utils.decorator.plugin_decorators import plugin_stats_decorator
|
||||||
@@ -54,7 +56,9 @@ class BeautyLegPlugin(MessagePluginInterface):
|
|||||||
self._commands = self._config.get("Beautyleg", {}).get("command", ["美腿", "腿来"])
|
self._commands = self._config.get("Beautyleg", {}).get("command", ["美腿", "腿来"])
|
||||||
self.command_format = self._config.get("Beautyleg", {}).get("command-format", "美腿")
|
self.command_format = self._config.get("Beautyleg", {}).get("command-format", "美腿")
|
||||||
self.enable = self._config.get("Beautyleg", {}).get("enable", True)
|
self.enable = self._config.get("Beautyleg", {}).get("enable", True)
|
||||||
|
config_image_folder = self._config.get("Beautyleg", {}).get("image_folder")
|
||||||
|
if config_image_folder:
|
||||||
|
self.image_folder = config_image_folder
|
||||||
# 检查图片文件夹是否存在
|
# 检查图片文件夹是否存在
|
||||||
if not os.path.exists(self.image_folder):
|
if not os.path.exists(self.image_folder):
|
||||||
self.LOG.warning(f"图片文件夹不存在: {self.image_folder}")
|
self.LOG.warning(f"图片文件夹不存在: {self.image_folder}")
|
||||||
@@ -110,7 +114,7 @@ class BeautyLegPlugin(MessagePluginInterface):
|
|||||||
# 发送图片
|
# 发送图片
|
||||||
random_file_path = os.path.abspath(random_file_path)
|
random_file_path = os.path.abspath(random_file_path)
|
||||||
self.LOG.info(f"BeautyLeg.random_file_path: {random_file_path}")
|
self.LOG.info(f"BeautyLeg.random_file_path: {random_file_path}")
|
||||||
result = await bot.send_image_message((roomid if roomid else sender), random_file_path)
|
result = await bot.send_image_message((roomid if roomid else sender), Path(random_file_path))
|
||||||
self.LOG.info(f"发送图片结果: {result}")
|
self.LOG.info(f"发送图片结果: {result}")
|
||||||
return True, "发送成功"
|
return True, "发送成功"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user