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: