From aeeceeb32b1cfd3c3894080a4a7a6c07b6977e8d Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Thu, 2 Oct 2025 00:06:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E8=BD=AC=E4=B9=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/message_receive/bot.py | 2 +- src/config/config.py | 9 ++------- template/model_config_template.toml | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/chat/message_receive/bot.py b/src/chat/message_receive/bot.py index 89e9bb5a..03f6ed02 100644 --- a/src/chat/message_receive/bot.py +++ b/src/chat/message_receive/bot.py @@ -153,7 +153,7 @@ class ChatBot: if message.message_info.message_id == "notice": message.is_notify = True logger.info("notice消息") - # print(message) + print(message) return True diff --git a/src/config/config.py b/src/config/config.py index 4a34fae8..85d55bff 100644 --- a/src/config/config.py +++ b/src/config/config.py @@ -174,13 +174,8 @@ def _update_dict(target: TOMLDocument | dict | Table, source: TOMLDocument | dic _update_dict(target_value, value) else: try: - # 对数组类型进行特殊处理 - if isinstance(value, list): - # 如果是空数组,确保它保持为空数组 - target[key] = tomlkit.array(str(value)) if value else tomlkit.array() - else: - # 其他类型使用item方法创建新值 - target[key] = tomlkit.item(value) + # 统一使用 tomlkit.item 来保持原生类型与转义,不对列表做字符串化处理 + target[key] = tomlkit.item(value) except (TypeError, ValueError): # 如果转换失败,直接赋值 target[key] = value diff --git a/template/model_config_template.toml b/template/model_config_template.toml index fa2b02f4..c97a6579 100644 --- a/template/model_config_template.toml +++ b/template/model_config_template.toml @@ -1,5 +1,5 @@ [inner] -version = "1.7.3" +version = "1.7.4" # 配置文件版本号迭代规则同bot_config.toml