重大版本调整:gewechat兼容。

This commit is contained in:
liuwei
2025-04-22 11:17:03 +08:00
parent 41def62467
commit a62bb61901
48 changed files with 2855 additions and 1420 deletions

View File

@@ -3,8 +3,6 @@ import os
import random
from typing import Dict, Any, List, Optional, Tuple
from wcferry import Wcf
from plugin_common.message_plugin_interface import MessagePluginInterface
from plugin_common.plugin_interface import PluginStatus
from utils.decorator.plugin_decorators import plugin_stats_decorator
@@ -49,7 +47,6 @@ class XiurenImagePlugin(MessagePluginInterface):
self.LOG.info(f"正在初始化 {self.name} 插件...")
# 保存上下文对象
self.wcf = context.get("wcf")
self.event_system = context.get("event_system")
self.message_util = context.get("message_util")
@@ -95,7 +92,6 @@ class XiurenImagePlugin(MessagePluginInterface):
self.LOG.info(f"插件执行: {self.name}{content}")
sender = message.get("sender")
roomid = message.get("roomid", "")
wcf: Wcf = message.get("wcf")
gbm: GroupBotManager = message.get("gbm")
# 检查权限
@@ -106,12 +102,12 @@ class XiurenImagePlugin(MessagePluginInterface):
# 获取随机图片
pic_path = self._get_random_pic()
if not pic_path:
wcf.send_text(f"❌未找到图片资源",
self.message_util.send_text(f"❌未找到图片资源",
(roomid if roomid else sender), sender)
return False, "未找到图片资源"
# 发送图片
result = wcf.send_file(pic_path, (roomid if roomid else sender))
result = self.message_util.send_file(pic_path, (roomid if roomid else sender))
self.LOG.info(f"发送图片结果: {result}")
return True, "发送成功"