modified: bot.py

This commit is contained in:
SimolZimol
2026-06-22 18:19:05 +02:00
parent a2e340ef7c
commit bc7b5674eb

13
bot.py
View File

@@ -4909,19 +4909,16 @@ async def get_message_data(channel, message_id, context_range=3):
attachment_info = {
"filename": attachment.filename,
"url": attachment.url,
"proxy_url": attachment.proxy_url,
"size": attachment.size,
"content_type": attachment.content_type,
"attachment_id": str(attachment.id)
"attachment_id": str(attachment.id),
"saved_permanently": False,
"local_path": None
}
# NEW: add local saved file info if download worked
if downloaded_file:
attachment_info["local_path"] = downloaded_file.get("local_path")
if downloaded_file and downloaded_file.get("local_path"):
attachment_info["saved_permanently"] = True
else:
attachment_info["saved_permanently"] = False
attachment_info["local_path"] = downloaded_file["local_path"]
attachments_data.append(attachment_info)