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)