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,
|
download_data: DownloadQueryData,
|
||||||
need_delete_message: bool,
|
need_delete_message: bool,
|
||||||
) -> BotHandlerInternal {
|
) -> BotHandlerInternal {
|
||||||
|
match cache {
|
||||||
|
BotCache::Original | BotCache::Cache => {
|
||||||
send_cached_message(message, bot, download_data, need_delete_message, cache).await
|
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(
|
async fn get_download_keyboard_handler(
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ pub async fn get_cached_message(
|
|||||||
file_type: format,
|
file_type: format,
|
||||||
} = download_data;
|
} = download_data;
|
||||||
|
|
||||||
let is_need_copy = bot_cache != BotCache::Original;
|
let is_need_copy = bot_cache == BotCache::Cache;
|
||||||
|
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
let response = client
|
let response = client
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ use crate::config;
|
|||||||
pub enum BotCache {
|
pub enum BotCache {
|
||||||
#[serde(rename = "original")]
|
#[serde(rename = "original")]
|
||||||
Original,
|
Original,
|
||||||
|
#[serde(rename = "cache")]
|
||||||
|
Cache,
|
||||||
#[serde(rename = "no_cache")]
|
#[serde(rename = "no_cache")]
|
||||||
NoCache,
|
NoCache,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user