diff --git a/src-tauri/src/networking/astrbot_client.rs b/src-tauri/src/networking/astrbot_client.rs index 2ff2ab9..31eca9f 100644 --- a/src-tauri/src/networking/astrbot_client.rs +++ b/src-tauri/src/networking/astrbot_client.rs @@ -492,10 +492,16 @@ impl AstrBotClient { } let encoded = urlencoding_username(attachment_id); let mut last_note = String::new(); + // Current AstrBot serves both forms under `/api/v1/files`. By name + // first, because that is what a media frame carries; by id second, + // because markers already stored in history hold the id from + // `attachment_saved`. The `/api/chat/*` pair is what older builds + // exposed, kept last so an un-upgraded server still works. for path in [ + format!("/api/v1/files/content?filename={encoded}"), + format!("/api/v1/files/{encoded}/content"), format!("/api/chat/get_file?filename={encoded}"), format!("/api/chat/get_attachment?attachment_id={encoded}"), - format!("/api/v1/files/content?filename={encoded}"), ] { match self.try_attachment(&path).await? { Ok(found) => return Ok(found),