[Update] Message Format: config.jsonで元々のkey "MESSAGE_FORMAT"が存在していた場合、"SEND_MESSAGE_FORMAT_WITH_T"へと引き継ぐ処理追加。

This commit is contained in:
Sakamoto Shiina
2023-12-19 22:28:18 +09:00
parent 6a9732aaa8
commit 8a0b2de540

View File

@@ -667,8 +667,13 @@ class Config:
with open(self.PATH_CONFIG, 'r', encoding="utf-8") as fp:
config = json_load(fp)
old_message_format = None
for key in config.keys():
if key == "MESSAGE_FORMAT":
old_message_format = config[key]
setattr(self, key, config[key])
if old_message_format is not None:
setattr(self, "SEND_MESSAGE_FORMAT_WITH_T", old_message_format)
with open(self.PATH_CONFIG, 'w', encoding="utf-8") as fp:
config = {}