From 5bd5dd6b0185ebb0283ca23d90aec6d21671d317 Mon Sep 17 00:00:00 2001
From: CMHopeSunshine <277073121@qq.com>
Date: Sun, 27 Nov 2022 20:47:48 +0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BC=98=E5=8C=96`=E6=9D=83?=
=?UTF-8?q?=E9=99=90=E7=AE=A1=E7=90=86`?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
LittlePaimon/plugins/plugin_manager/__init__.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/LittlePaimon/plugins/plugin_manager/__init__.py b/LittlePaimon/plugins/plugin_manager/__init__.py
index 44fc5a7..84c42bc 100644
--- a/LittlePaimon/plugins/plugin_manager/__init__.py
+++ b/LittlePaimon/plugins/plugin_manager/__init__.py
@@ -129,6 +129,7 @@ async def _(state: T_State):
msg = f'已{"启用" if state["bool"] else "禁用"}群{" ".join(map(str, state["group"]))}的插件{" ".join(state["plugin"]) if not state["is_all"] else "全部"}使用权限{extra_msg}'
else:
filter_arg['user_id__in'] = state['user']
+ filter_arg['group_id'] = None
logger.info('插件管理器',
f'已{"启用" if state["bool"] else "禁用"}用户{" ".join(map(str, state["user"]))}的插件{" ".join(state["plugin"]) if not state["is_all"] else "全部"}使用权限')
msg = f'已{"启用" if state["bool"] else "禁用"}用户{" ".join(map(str, state["user"]))}的插件{" ".join(state["plugin"]) if not state["is_all"] else "全部"}使用权限{extra_msg}'
@@ -142,10 +143,10 @@ async def _(state: T_State):
for user in state['user']:
await PluginDisable.update_or_create(name=plugin, group_id=group, user_id=user)
else:
- await PluginDisable.update_or_create(name=plugin, group_id=group)
+ await PluginDisable.update_or_create(name=plugin, group_id=group, user_id=None)
else:
for user in state['user']:
- await PluginDisable.update_or_create(name=plugin, user_id=user)
+ await PluginDisable.update_or_create(name=plugin, user_id=user, group_id=None)
await manage_cmd.finish(msg)