去除初始化问题!
This commit is contained in:
@@ -47,15 +47,8 @@ class GroupAddPlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
# 保存上下文对象
|
# 保存上下文对象
|
||||||
self.wcf = context.get("wcf")
|
self.wcf = context.get("wcf")
|
||||||
if not self.wcf:
|
|
||||||
self.LOG.error("无法获取wcf对象,插件初始化失败")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 获取群管理器
|
# 获取群管理器
|
||||||
self.gbm = context.get("gbm")
|
self.gbm = context.get("gbm")
|
||||||
if not self.gbm:
|
|
||||||
self.LOG.error("无法获取群管理器对象,插件初始化失败")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 从配置中获取启用状态
|
# 从配置中获取启用状态
|
||||||
plugin_config = self._config.get("GroupAdd", {})
|
plugin_config = self._config.get("GroupAdd", {})
|
||||||
|
|||||||
@@ -51,21 +51,10 @@ class GroupAutoInvitePlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
# 保存上下文对象
|
# 保存上下文对象
|
||||||
self.wcf = context.get("wcf")
|
self.wcf = context.get("wcf")
|
||||||
if not self.wcf:
|
|
||||||
self.LOG.error("无法获取wcf对象,插件初始化失败")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 获取群管理器
|
# 获取群管理器
|
||||||
self.gbm = context.get("gbm")
|
self.gbm = context.get("gbm")
|
||||||
if not self.gbm:
|
|
||||||
self.LOG.error("无法获取群管理器对象,插件初始化失败")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 获取Redis连接池
|
# 获取Redis连接池
|
||||||
self.redis_pool = context.get("redis_pool")
|
self.redis_pool = context.get("redis_pool")
|
||||||
if not self.redis_pool:
|
|
||||||
self.LOG.error("无法获取Redis连接池,插件初始化失败")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 从配置中获取命令和启用状态
|
# 从配置中获取命令和启用状态
|
||||||
plugin_config = self._config.get("GroupAutoInvite", {})
|
plugin_config = self._config.get("GroupAutoInvite", {})
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
self.status = PluginStatus.LOADED
|
self.status = PluginStatus.LOADED
|
||||||
|
|
||||||
self.wcf = None
|
|
||||||
self.gbm = None
|
|
||||||
self.LOG = logging.getLogger(f"Plugin.{self.name}")
|
self.LOG = logging.getLogger(f"Plugin.{self.name}")
|
||||||
|
|
||||||
# 初始化本地缓存字典,使用 group_id 作为键
|
# 初始化本地缓存字典,使用 group_id 作为键
|
||||||
@@ -54,15 +52,8 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
# 保存上下文对象
|
# 保存上下文对象
|
||||||
self.wcf: Wcf = context.get("wcf")
|
self.wcf: Wcf = context.get("wcf")
|
||||||
if not self.wcf:
|
|
||||||
self.LOG.error("无法获取wcf对象,插件初始化失败")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 获取群管理器
|
# 获取群管理器
|
||||||
self.gbm = context.get("gbm")
|
self.gbm = context.get("gbm")
|
||||||
if not self.gbm:
|
|
||||||
self.LOG.error("无法获取群管理器对象,插件初始化失败")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# 从配置中获取启用状态和检查间隔
|
# 从配置中获取启用状态和检查间隔
|
||||||
plugin_config = self._config.get("GroupMemberChange", {})
|
plugin_config = self._config.get("GroupMemberChange", {})
|
||||||
|
|||||||
Reference in New Issue
Block a user