From 7ba2fb9584a61f0450c8fef9e7bb9fa3b45521ab Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Sat, 28 May 2022 20:55:14 +0800 Subject: [PATCH] update black_word --- README.md | 2 ++ plugins/black_word/__init__.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index d4898736..194c8877 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,8 @@ __Docker 最新版本由 [Sakuracio](https://github.com/Sakuracio) 提供__ * 当图库无图片时,戳一戳将略过发送图片 * 新增搜图提供配置项```ALLOW_GROUP_R18```:允许在群聊中使用r18参数 * 新增自动更新插件```UPDATE_REMIND```:新版本提醒,原配置项```AUTO_UPDATE_ZHENXUN```改为自动更新升级 +* black_word新增当群权限为-1时不再检测该群 +* 修复非超级用户绑定原神cookie会被black_word阻拦 ### 2022/5/26 diff --git a/plugins/black_word/__init__.py b/plugins/black_word/__init__.py index 9364959a..1e1b1639 100644 --- a/plugins/black_word/__init__.py +++ b/plugins/black_word/__init__.py @@ -8,6 +8,7 @@ from nonebot.adapters.onebot.v11 import ( from nonebot.matcher import Matcher from nonebot.message import run_preprocessor from utils.image_utils import BuildImage +from utils.manager import group_manager from utils.utils import get_message_text, is_number from nonebot.params import RegexGroup, CommandArg from .utils import black_word_manager @@ -155,7 +156,11 @@ async def _( and matcher.plugin_name == "black_word" and not await BanUser.is_ban(event.user_id) and str(event.user_id) not in bot.config.superusers + and not get_message_text(event.json()).startswith("原神绑定") ): + # 屏蔽群权限-1的群 + if isinstance(event, GroupMessageEvent) and group_manager.get_group_level(event.group_id) < 0: + return user_id = event.user_id group_id = event.group_id if isinstance(event, GroupMessageEvent) else None msg = get_message_text(event.json())