重大版本调整: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

@@ -6,8 +6,7 @@ import traceback
import requests
from typing import Dict, Any, List, Optional, Tuple
from wcferry import Wcf
from message_util import MessageUtil
from plugin_common.message_plugin_interface import MessagePluginInterface
from plugin_common.plugin_interface import PluginStatus
from utils.decorator.plugin_decorators import plugin_stats_decorator
@@ -61,9 +60,8 @@ class DouyinParserPlugin(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")
self.message_util:MessageUtil = context.get("message_util")
self.gbm = context.get("gbm")
# 从配置中获取参数
@@ -103,7 +101,6 @@ class DouyinParserPlugin(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")
# 检查权限
@@ -138,14 +135,14 @@ class DouyinParserPlugin(MessagePluginInterface):
# 下载并发送文件
mp4_path = self._download_stream(video_url, os.path.join(self.download_dir, "douyin.mp4"))
if mp4_path:
wcf.send_file(mp4_path, (roomid if roomid else sender))
self.message_util.send_file(mp4_path, (roomid if roomid else sender))
return True, "发送视频文件成功"
else:
print(f"❌下载视频失败")
return False, "下载视频失败"
else:
# 发送卡片
wcf.send_rich_text(
self.message_util.send_rich_text(
"BOT-PC直接查看",
"gh_11",
title[:30],