mirror of
https://github.com/TriM-Organization/LiteyukiBot-TriM.git
synced 2024-11-15 03:44:49 +08:00
Merge branch 'main' of https://gitee.com/TriM-Organization/LiteyukiBot-TriM
This commit is contained in:
commit
db6045ced7
@ -297,11 +297,15 @@ async def _(
|
|||||||
|
|
||||||
file_2_write = (cmd_arg[1] + ".txt") if len(cmd_arg) > 1 else "新建文本文档.txt"
|
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 "-a" in whole_texts[0]:
|
||||||
if file_2_write in filesaves[usr_id].keys():
|
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)
|
file_size = os.path.getsize(file_path)
|
||||||
filesaves[usr_id]["totalSize"] += (
|
filesaves[usr_id]["totalSize"] += (
|
||||||
file_size - filesaves[usr_id][file_2_write]["size"]
|
file_size - filesaves[usr_id][file_2_write]["size"]
|
||||||
|
Loading…
Reference in New Issue
Block a user