mirror of https://github.com/Mai-with-u/MaiBot.git
fix:修复转义问题
parent
993f85bfeb
commit
aeeceeb32b
|
|
@ -153,7 +153,7 @@ class ChatBot:
|
||||||
if message.message_info.message_id == "notice":
|
if message.message_info.message_id == "notice":
|
||||||
message.is_notify = True
|
message.is_notify = True
|
||||||
logger.info("notice消息")
|
logger.info("notice消息")
|
||||||
# print(message)
|
print(message)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,13 +174,8 @@ def _update_dict(target: TOMLDocument | dict | Table, source: TOMLDocument | dic
|
||||||
_update_dict(target_value, value)
|
_update_dict(target_value, value)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
# 对数组类型进行特殊处理
|
# 统一使用 tomlkit.item 来保持原生类型与转义,不对列表做字符串化处理
|
||||||
if isinstance(value, list):
|
target[key] = tomlkit.item(value)
|
||||||
# 如果是空数组,确保它保持为空数组
|
|
||||||
target[key] = tomlkit.array(str(value)) if value else tomlkit.array()
|
|
||||||
else:
|
|
||||||
# 其他类型使用item方法创建新值
|
|
||||||
target[key] = tomlkit.item(value)
|
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
# 如果转换失败,直接赋值
|
# 如果转换失败,直接赋值
|
||||||
target[key] = value
|
target[key] = value
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
[inner]
|
[inner]
|
||||||
version = "1.7.3"
|
version = "1.7.4"
|
||||||
|
|
||||||
# 配置文件版本号迭代规则同bot_config.toml
|
# 配置文件版本号迭代规则同bot_config.toml
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue