mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix getting cached messages
This commit is contained in:
@@ -45,6 +45,12 @@ pub async fn get_cached_message(
|
||||
Err(err) => return Err(Box::new(err)),
|
||||
};
|
||||
|
||||
if response.status() != StatusCode::OK {
|
||||
return Err(Box::new(DownloadError {
|
||||
status_code: response.status()
|
||||
}));
|
||||
};
|
||||
|
||||
match response.json::<CachedMessage>().await {
|
||||
Ok(v) => Ok(v),
|
||||
Err(err) => Err(Box::new(err)),
|
||||
@@ -84,6 +90,8 @@ pub async fn download_file(
|
||||
|
||||
let headers = response.headers();
|
||||
|
||||
log::info!("{:?}", headers);
|
||||
|
||||
let filename = headers
|
||||
.get("content-disposition")
|
||||
.unwrap()
|
||||
|
||||
Reference in New Issue
Block a user