This commit is contained in:
EillesWan 2024-11-09 13:41:45 +08:00
commit db6045ced7

View File

@ -297,11 +297,15 @@ async def _(
file_2_write = (cmd_arg[1] + ".txt") if len(cmd_arg) > 1 else "新建文本文档.txt"
file_path = get_stored_path(usr_id, file_2_write, superuser=False)
(file_path := get_stored_path(usr_id, file_2_write, superuser=False)).parent.mkdir(
parents=True, exist_ok=True
)
if "-a" in whole_texts[0]:
if file_2_write in filesaves[usr_id].keys():
await write_file(file_path,content=whole_texts[1], mode="a", encoding="utf-8")
await write_file(
file_path, content=whole_texts[1], mode="a", encoding="utf-8"
)
file_size = os.path.getsize(file_path)
filesaves[usr_id]["totalSize"] += (
file_size - filesaves[usr_id][file_2_write]["size"]