调整新用户信息
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import logging
|
||||
import threading
|
||||
import time
|
||||
from datetime import datetime
|
||||
from typing import Dict, Any, List, Optional, Tuple
|
||||
|
||||
@@ -9,7 +7,6 @@ import xml.etree.ElementTree as ET
|
||||
import dacite
|
||||
|
||||
from gewechat.client import gewe_client
|
||||
from gewechat.response.gewe_resp import GeweResponse
|
||||
from gewechat.response.model.group.chatroom_member_detail import ChatroomMemberDetail
|
||||
from plugin_common.message_plugin_interface import MessagePluginInterface
|
||||
from plugin_common.plugin_interface import PluginStatus
|
||||
@@ -49,20 +46,8 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.status = PluginStatus.LOADED
|
||||
|
||||
self.LOG = logging.getLogger(f"Plugin.{self.name}")
|
||||
|
||||
# 初始化本地缓存字典,使用 group_id 作为键
|
||||
self.local_members = {}
|
||||
|
||||
# 监控线程
|
||||
self.monitor_thread = None
|
||||
self.stop_flag = False
|
||||
|
||||
# 检查间隔时间(秒)
|
||||
self.check_interval = 30
|
||||
|
||||
def initialize(self, context: Dict[str, Any]) -> bool:
|
||||
"""初始化插件"""
|
||||
self.LOG.info(f"正在初始化 {self.name} 插件...")
|
||||
@@ -70,11 +55,7 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
||||
# 创建消息工具实例message_util
|
||||
self.message_util: MessageUtil = context.get("message_util")
|
||||
|
||||
# 从配置中获取启用状态和检查间隔
|
||||
plugin_config = self._config.get("GroupMemberChange", {})
|
||||
self.check_interval = plugin_config.get("check_interval", 30)
|
||||
|
||||
self.LOG.info(f"{self.name} 插件初始化完成,检查间隔: {self.check_interval}秒")
|
||||
self.LOG.info(f"{self.name} 插件初始化完成")
|
||||
return True
|
||||
|
||||
def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
|
||||
@@ -82,7 +63,6 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
||||
|
||||
content = str(message.get("content", "")).strip()
|
||||
self.LOG.info(f"插件执行: {self.name}:{content}")
|
||||
command = content.split(" ")[0]
|
||||
sender = message.get("sender")
|
||||
roomid = message.get("roomid", "")
|
||||
gbm: GroupBotManager = message.get("gbm")
|
||||
|
||||
Reference in New Issue
Block a user