fix:修复转义问题

pull/1294/head
SengokuCola 2025-10-02 00:06:50 +08:00
parent 993f85bfeb
commit aeeceeb32b
3 changed files with 4 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
[inner]
version = "1.7.3"
version = "1.7.4"
# 配置文件版本号迭代规则同bot_config.toml