From 15e070232994c8ec195319b6ce3279ad7afd3a4b Mon Sep 17 00:00:00 2001 From: 13476573407 <1062424570@qq.com> Date: Wed, 20 Mar 2024 10:52:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BD=BF=E7=94=A8scanp?= =?UTF-8?q?=E9=87=8D=E8=BD=BD=E6=97=B6=E4=BC=9A=E9=87=8D=E6=96=B0=E7=94=9F?= =?UTF-8?q?=E6=88=90godcmd=E7=9A=84=E5=AE=9E=E4=BE=8B=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4auth=E6=9D=83=E9=99=90=E8=A2=AB=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/plugin_manager.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/plugins/plugin_manager.py b/plugins/plugin_manager.py index 8433e8f..cecf75d 100644 --- a/plugins/plugin_manager.py +++ b/plugins/plugin_manager.py @@ -141,19 +141,21 @@ class PluginManager: failed_plugins = [] for name, plugincls in self.plugins.items(): if plugincls.enabled: + if 'GODCMD' in self.instances and name == 'GODCMD': + continue # if name not in self.instances: - try: - instance = plugincls() - except Exception as e: - logger.warn("Failed to init %s, diabled. %s" % (name, e)) - self.disable_plugin(name) - failed_plugins.append(name) - continue - self.instances[name] = instance - for event in instance.handlers: - if event not in self.listening_plugins: - self.listening_plugins[event] = [] - self.listening_plugins[event].append(name) + try: + instance = plugincls() + except Exception as e: + logger.warn("Failed to init %s, diabled. %s" % (name, e)) + self.disable_plugin(name) + failed_plugins.append(name) + continue + self.instances[name] = instance + for event in instance.handlers: + if event not in self.listening_plugins: + self.listening_plugins[event] = [] + self.listening_plugins[event].append(name) self.refresh_order() return failed_plugins