From 28572cfd2c4677aa60850cce8b704143d9363012 Mon Sep 17 00:00:00 2001 From: 035966-L3 <139025318+035966-L3@users.noreply.github.com> Date: Wed, 17 Jun 2026 20:19:13 +0800 Subject: [PATCH 1/2] File Transfer Bugfix --- LTS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LTS.py b/LTS.py index 11c02b7..e076cbd 100644 --- a/LTS.py +++ b/LTS.py @@ -2069,7 +2069,7 @@ def thread_send(): # 先按文件处理 if not message["content"]["filename"]: # filename 字段为空(或者 filename 字段根本不存在),表明不是文件 impossible_value = message["content"]["impossible_key"] # 故意引发 KeyError - with open(message["content"]["filename"], "rb") as f: + with open(message["content"]["content"], "rb") as f: file_data = f.read() # 读取 do_distribute 或 do_transfer 函数先前写入到磁盘的对应文件 message["content"]["content"] = base64.b64encode(file_data).decode("utf-8") # 将 content 字段覆写为正确值 token = json.dumps(message["content"]) + "\n" From 1ab30991dd0e595593097c29036b37b5f6a3bdc3 Mon Sep 17 00:00:00 2001 From: 035966-L3 <139025318+035966-L3@users.noreply.github.com> Date: Wed, 17 Jun 2026 20:19:57 +0800 Subject: [PATCH 2/2] File Transfer Bugfix --- LTS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LTS.py b/LTS.py index 142efbe..bf01acb 100644 --- a/LTS.py +++ b/LTS.py @@ -2071,7 +2071,7 @@ def thread_send(): # 先按文件处理 if not message["content"]["filename"]: # filename 字段为空(或者 filename 字段根本不存在),表明不是文件 impossible_value = message["content"]["impossible_key"] # 故意引发 KeyError - with open(message["content"]["filename"], "rb") as f: + with open(message["content"]["content"], "rb") as f: file_data = f.read() # 读取 do_distribute 或 do_transfer 函数先前写入到磁盘的对应文件 message["content"]["content"] = base64.b64encode(file_data).decode("utf-8") # 将 content 字段覆写为正确值 token = json.dumps(message["content"]) + "\n"