重大版本调整: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,7 +3,6 @@ import re
from datetime import datetime
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
@@ -45,8 +44,6 @@ class GroupAddPlugin(MessagePluginInterface):
self.LOG = logging.getLogger(f"Plugin.{self.name}")
self.LOG.info(f"正在初始化 {self.name} 插件...")
# 保存上下文对象
self.wcf = context.get("wcf")
# 获取群管理器
self.gbm = context.get("gbm")
@@ -99,8 +96,7 @@ class GroupAddPlugin(MessagePluginInterface):
"""处理消息"""
content = message.get("content", "")
roomid = message.get("roomid", "")
wcf: Wcf = message.get("wcf")
self.LOG.info(f"插件执行: {self.name}{content}")
# 提取昵称
@@ -116,8 +112,8 @@ class GroupAddPlugin(MessagePluginInterface):
welcome_message = f"🎉 欢迎 【{nickname}】 加入群聊👋 \n 🕒 {now_time} 🕒 "
# 发送欢迎消息
wcf.send_text(welcome_message, roomid)
# self.me.send_text(welcome_message, roomid)
self.LOG.info(f"已发送欢迎消息给新成员 {nickname} 在群 {roomid}")
return True, f"已欢迎 {nickname}"