From 43cddb3580bd5bf32c03cd8f8f805c8177a1ceba Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Fri, 7 Oct 2022 22:07:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=8A=9F=E8=83=BD=E4=B8=8E?= =?UTF-8?q?=E8=A2=AB=E5=8A=A8=E6=97=B6=E4=B8=8D=E5=86=8D=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++++++++ basic_plugins/admin_bot_manage/_data_source.py | 6 +++--- utils/message_builder.py | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fc5b7396..8b0d0dac 100644 --- a/README.md +++ b/README.md @@ -286,6 +286,19 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能 ## 更新 +### 2022/10/7 + +* 修复 B 站请求返回 -401 错误 [@pull/1119](https://github.com/HibiKier/zhenxun_bot/pull/1119) +* 关闭功能与被动时不再区分大小写,同名时仅被动关闭操作生效 + +### 2022/9/30 + +* 修改重置开箱的使用权限 [@pull/1118](https://github.com/HibiKier/zhenxun_bot/pull/1118) + +### 2022/9/27 + +* 更新b站转发解析 [@pull/1117](https://github.com/HibiKier/zhenxun_bot/pull/1117) + ### 2022/9/24 * 修复b站订阅 [@pull/1112](https://github.com/HibiKier/zhenxun_bot/pull/1112) diff --git a/basic_plugins/admin_bot_manage/_data_source.py b/basic_plugins/admin_bot_manage/_data_source.py index 48ed0226..3abb4c4b 100644 --- a/basic_plugins/admin_bot_manage/_data_source.py +++ b/basic_plugins/admin_bot_manage/_data_source.py @@ -87,13 +87,13 @@ task_data = None async def change_group_switch(cmd: str, group_id: int, is_super: bool = False): - global task_data """ 修改群功能状态 :param cmd: 功能名称 :param group_id: 群号 :param is_super: 是否位超级用户,超级用户用于私聊开关功能状态 """ + global task_data if not task_data: task_data = group_manager.get_task_data() group_help_file = DATA_PATH / "group_help" / f"{group_id}.png" @@ -121,9 +121,9 @@ async def change_group_switch(cmd: str, group_id: int, is_super: bool = False): if group_help_file.exists(): group_help_file.unlink() return f"已 {status} 全部功能!" - if cmd in [task_data[x] for x in task_data.keys()]: + if cmd.lower() in [task_data[x].lower() for x in task_data.keys()]: type_ = "task" - modules = [x for x in task_data.keys() if task_data[x] == cmd] + modules = [x for x in task_data.keys() if task_data[x].lower() == cmd.lower()] for module in modules: if is_super: module = f"{module}:super" diff --git a/utils/message_builder.py b/utils/message_builder.py index a6b3d22b..f2331b7c 100755 --- a/utils/message_builder.py +++ b/utils/message_builder.py @@ -1,3 +1,4 @@ +import io from pathlib import Path from typing import List, Union @@ -26,7 +27,7 @@ def image( return MessageSegment.image(file) logger.warning(f"图片 {file.absolute()}缺失...") return "" - elif isinstance(file, bytes): + elif isinstance(file, (bytes, io.BytesIO)): return MessageSegment.image(file) elif b64: return MessageSegment.image(b64 if "base64://" in b64 else "base64://" + b64)