modified: bot.py
This commit is contained in:
13
bot.py
13
bot.py
@@ -4909,19 +4909,16 @@ async def get_message_data(channel, message_id, context_range=3):
|
|||||||
|
|
||||||
attachment_info = {
|
attachment_info = {
|
||||||
"filename": attachment.filename,
|
"filename": attachment.filename,
|
||||||
"url": attachment.url,
|
|
||||||
"proxy_url": attachment.proxy_url,
|
|
||||||
"size": attachment.size,
|
"size": attachment.size,
|
||||||
"content_type": attachment.content_type,
|
"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 and downloaded_file.get("local_path"):
|
||||||
if downloaded_file:
|
|
||||||
attachment_info["local_path"] = downloaded_file.get("local_path")
|
|
||||||
attachment_info["saved_permanently"] = True
|
attachment_info["saved_permanently"] = True
|
||||||
else:
|
attachment_info["local_path"] = downloaded_file["local_path"]
|
||||||
attachment_info["saved_permanently"] = False
|
|
||||||
|
|
||||||
attachments_data.append(attachment_info)
|
attachments_data.append(attachment_info)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user