This commit is contained in:
2024-05-05 19:18:37 +02:00
parent a509647ed0
commit d39bf20175
3 changed files with 11 additions and 2 deletions

View File

@@ -205,8 +205,15 @@ async fn download_handler(
download_data: DownloadQueryData,
need_delete_message: bool,
) -> BotHandlerInternal {
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(
message: Message,

View File

@@ -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

View File

@@ -6,6 +6,8 @@ use crate::config;
pub enum BotCache {
#[serde(rename = "original")]
Original,
#[serde(rename = "cache")]
Cache,
#[serde(rename = "no_cache")]
NoCache,
}