From 206b86ea90ab3d7d6b0ab0a811d2f829d2dbacae Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Wed, 24 Aug 2022 23:41:33 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=8E=BB=E6=8E=89=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E6=8F=90=E7=A4=BA=EF=BC=8C=E6=96=B0=E7=BE=A4?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=9C=89=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/manager/plugin_manager/__init__.py | 2 +- LittlePaimon/manager/plugin_manager/manager.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LittlePaimon/manager/plugin_manager/__init__.py b/LittlePaimon/manager/plugin_manager/__init__.py index 3327cff..339dff4 100644 --- a/LittlePaimon/manager/plugin_manager/__init__.py +++ b/LittlePaimon/manager/plugin_manager/__init__.py @@ -106,7 +106,7 @@ async def _(event: MessageEvent, matcher: Matcher): perm = await PluginPermission.get_or_none(name=matcher.plugin_name, session_id=session_id, session_type=session_type) if not perm: - raise IgnoredException('插件使用权限未设置') + return if not perm.status: raise IgnoredException('插件使用权限已禁用') if isinstance(event, GroupMessageEvent) and event.user_id in perm.ban: diff --git a/LittlePaimon/manager/plugin_manager/manager.py b/LittlePaimon/manager/plugin_manager/manager.py index 7d208a6..a4f9af5 100644 --- a/LittlePaimon/manager/plugin_manager/manager.py +++ b/LittlePaimon/manager/plugin_manager/manager.py @@ -40,8 +40,8 @@ class PluginManager: """ if self.config_path.exists(): self.config = load_yaml(self.config_path) - else: - logger.warning('插件管理器', '无法读取LittlePaimon配置文件,请检查目录') + # else: + # logger.warning('插件管理器', '无法读取LittlePaimon配置文件,请检查目录') for file in self.plugin_config_path.iterdir(): if file.is_file() and file.name.endswith('.yml'): data = load_yaml(file)