重大版本调整:gewechat兼容。
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import logging
|
||||
from typing import Dict, Any, List, Optional, Tuple
|
||||
|
||||
from wcferry import Wcf
|
||||
|
||||
from gewechat.call_back_message.message import WxMessage
|
||||
from message_util import MessageUtil
|
||||
from plugin_common.message_plugin_interface import MessagePluginInterface
|
||||
from plugin_common.plugin_interface import PluginStatus
|
||||
@@ -51,7 +50,6 @@ class GroupVirtualPlugin(MessagePluginInterface):
|
||||
self.LOG.info(f"正在初始化 {self.name} 插件...")
|
||||
|
||||
# 保存上下文对象
|
||||
self.wcf: Wcf = context.get("wcf")
|
||||
self.event_system = context.get("event_system")
|
||||
self.message_util: MessageUtil = context.get("message_util")
|
||||
|
||||
@@ -99,9 +97,9 @@ class GroupVirtualPlugin(MessagePluginInterface):
|
||||
"""处理消息"""
|
||||
roomid = message.get("roomid", "")
|
||||
sender = message.get("sender", "")
|
||||
|
||||
full_wx_msg: WxMessage = message.get("full_wx_msg", "")
|
||||
# 检查是否是机器人自己发送的消息
|
||||
if sender == self.wcf.self_wxid:
|
||||
if full_wx_msg.from_self():
|
||||
return False, "不转发自己的消息"
|
||||
|
||||
# 获取该群所在的所有虚拟聊天组
|
||||
|
||||
Reference in New Issue
Block a user