From 983264dc1a228833050c1c7b6c592edb2346bd5f Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 02:51:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E6=9C=AA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E4=B8=B4=E6=97=B6=E7=9B=AE=E5=BD=95=E5=8F=98?= =?UTF-8?q?=E9=87=8F=20(#3286)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial plan * fix: 移除未使用的临时目录变量 (ruff check --fix) Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com> --- astrbot/core/message/components.py | 3 --- .../core/platform/sources/wechatpadpro/wechatpadpro_adapter.py | 1 - packages/python_interpreter/main.py | 1 - 3 files changed, 5 deletions(-) diff --git a/astrbot/core/message/components.py b/astrbot/core/message/components.py index 51c9dc84..c2cdfdca 100644 --- a/astrbot/core/message/components.py +++ b/astrbot/core/message/components.py @@ -152,7 +152,6 @@ class Record(BaseMessageComponent): if self.file.startswith("base64://"): bs64_data = self.file.removeprefix("base64://") image_bytes = base64.b64decode(bs64_data) - temp_dir = str(AstrbotPaths.astrbot_root / "temp") file_path = str(AstrbotPaths.astrbot_root / "temp" / f"{uuid.uuid4()}.jpg") with open(file_path, "wb") as f: f.write(image_bytes) @@ -241,7 +240,6 @@ class Video(BaseMessageComponent): if url and url.startswith("file:///"): return url[8:] if url and url.startswith("http"): - download_dir = str(AstrbotPaths.astrbot_root / "temp") video_file_path = str( AstrbotPaths.astrbot_root / "temp" / f"{uuid.uuid4().hex}" ) @@ -443,7 +441,6 @@ class Image(BaseMessageComponent): if url.startswith("base64://"): bs64_data = url.removeprefix("base64://") image_bytes = base64.b64decode(bs64_data) - temp_dir = str(AstrbotPaths.astrbot_root / "temp") image_file_path = str( AstrbotPaths.astrbot_root / "temp" / f"{uuid.uuid4()}.jpg" ) diff --git a/astrbot/core/platform/sources/wechatpadpro/wechatpadpro_adapter.py b/astrbot/core/platform/sources/wechatpadpro/wechatpadpro_adapter.py index c492d345..fc5ff102 100644 --- a/astrbot/core/platform/sources/wechatpadpro/wechatpadpro_adapter.py +++ b/astrbot/core/platform/sources/wechatpadpro/wechatpadpro_adapter.py @@ -786,7 +786,6 @@ class WeChatPadProAdapter(Platform): voice_bs64_data = voice_resp.get("Data", {}).get("Base64", None) if voice_bs64_data: voice_bs64_data = base64.b64decode(voice_bs64_data) - temp_dir = str(AstrbotPaths.astrbot_root / "temp") file_path = str( AstrbotPaths.astrbot_root / "temp" diff --git a/packages/python_interpreter/main.py b/packages/python_interpreter/main.py index c6c1b743..05804e5b 100644 --- a/packages/python_interpreter/main.py +++ b/packages/python_interpreter/main.py @@ -214,7 +214,6 @@ class Main(star.Star): file_path = await comp.get_file() if file_path.startswith("http"): name = comp.name if comp.name else uuid.uuid4().hex[:8] - temp_dir = str(AstrbotPaths.astrbot_root / "temp") path = str(AstrbotPaths.astrbot_root / "temp" / name) await download_file(file_path, path) else: