mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
Fix
This commit is contained in:
@@ -205,7 +205,14 @@ async fn download_handler(
|
||||
download_data: DownloadQueryData,
|
||||
need_delete_message: bool,
|
||||
) -> BotHandlerInternal {
|
||||
send_cached_message(message, bot, download_data, need_delete_message, cache).await
|
||||
match cache {
|
||||
BotCache::Original | BotCache::Cache => {
|
||||
send_cached_message(message, bot, download_data, need_delete_message, cache).await
|
||||
}
|
||||
BotCache::NoCache => {
|
||||
send_with_download_from_channel(message, bot, download_data, need_delete_message).await
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn get_download_keyboard_handler(
|
||||
|
||||
@@ -30,7 +30,7 @@ pub async fn get_cached_message(
|
||||
file_type: format,
|
||||
} = download_data;
|
||||
|
||||
let is_need_copy = bot_cache != BotCache::Original;
|
||||
let is_need_copy = bot_cache == BotCache::Cache;
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let response = client
|
||||
|
||||
@@ -6,6 +6,8 @@ use crate::config;
|
||||
pub enum BotCache {
|
||||
#[serde(rename = "original")]
|
||||
Original,
|
||||
#[serde(rename = "cache")]
|
||||
Cache,
|
||||
#[serde(rename = "no_cache")]
|
||||
NoCache,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user