From cd2664a668da65a4207682721597690829e30393 Mon Sep 17 00:00:00 2001 From: student_2333 Date: Wed, 30 Oct 2024 01:56:37 +0800 Subject: [PATCH] up --- README.md | 4 ++++ nonebot_plugin_nailongremove/__init__.py | 2 +- nonebot_plugin_nailongremove/handler.py | 13 +++++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c71ee1d..c6976e7 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,10 @@ plugins = [ ## 📝 更新日志 +### 2.1.3 + +- 修复忽略群管与超级用户无效的 Bug + ### 2.1.2 - 重构部分代码,修复潜在 Bug diff --git a/nonebot_plugin_nailongremove/__init__.py b/nonebot_plugin_nailongremove/__init__.py index 3fe1ed1..90ae2e3 100644 --- a/nonebot_plugin_nailongremove/__init__.py +++ b/nonebot_plugin_nailongremove/__init__.py @@ -9,7 +9,7 @@ require("nonebot_plugin_uninfo") from . import handler as handler from .config import Config -__version__ = "2.1.2" +__version__ = "2.1.3" __plugin_meta__ = PluginMetadata( name="自动撤回奶龙", description="一个基于图像分类模型的简单插件~", diff --git a/nonebot_plugin_nailongremove/handler.py b/nonebot_plugin_nailongremove/handler.py index 3eb8362..c1c8105 100644 --- a/nonebot_plugin_nailongremove/handler.py +++ b/nonebot_plugin_nailongremove/handler.py @@ -67,15 +67,12 @@ async def nailong_rule( return ( # check if it's a group chat bool(session.member) # this prop only exists in group chats - # bypass + # bypass superuser + and ((not config.nailong_bypass_superuser) or (not await SUPERUSER(bot, event))) + # bypass group admin and ( - # bypass superuser - ((not config.nailong_bypass_superuser) or (not await SUPERUSER(bot, event))) - # bypass group admin - or ( - (not config.nailong_bypass_admin) - or ((not session.member.role) or session.member.role.level <= 1) - ) + (not config.nailong_bypass_admin) + or ((not session.member.role) or session.member.role.level <= 1) ) # msg has image and ((Image in msg) or (MarketFace in msg))