Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions astrbot/core/message/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ async def convert_to_file_path(self) -> str:
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)
Expand Down Expand Up @@ -241,7 +240,6 @@ async def convert_to_file_path(self) -> str:
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}"
)
Expand Down Expand Up @@ -443,7 +441,6 @@ async def convert_to_file_path(self) -> str:
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"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ async def _process_message_content(
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"
Expand Down
1 change: 0 additions & 1 deletion packages/python_interpreter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ async def on_message(self, event: AstrMessageEvent):
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:
Expand Down