重大版本调整:gewechat兼容。
This commit is contained in:
@@ -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}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user