mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fixes
This commit is contained in:
@@ -59,7 +59,7 @@ impl FromStr for DownloadArchiveQueryData {
|
||||
type Err = strum::ParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let re = Regex::new(r"^da_(?P<obj_type>[s|a|t])_(?P<id>\d+)_(?P<file_type>\w+)$").unwrap();
|
||||
let re = Regex::new(r"^da_(?P<obj_type>[sat])_(?P<id>\d+)_(?P<file_type>\w+)$").unwrap();
|
||||
|
||||
let caps = re.captures(s);
|
||||
let caps = match caps {
|
||||
|
||||
@@ -54,7 +54,7 @@ impl ToString for DownloadArchiveCommand {
|
||||
|
||||
impl CommandParse<Self> for DownloadArchiveCommand {
|
||||
fn parse(s: &str, bot_name: &str) -> Result<Self, strum::ParseError> {
|
||||
let re = Regex::new(r"^/da_(?P<type>[s|a|t])_(?P<id>\d+)$").unwrap();
|
||||
let re = Regex::new(r"^/da_(?P<type>[sat])_(?P<id>\d+)$").unwrap();
|
||||
|
||||
let full_bot_name = format!("@{bot_name}");
|
||||
let after_replace = s.replace(&full_bot_name, "");
|
||||
@@ -1,4 +1,4 @@
|
||||
pub mod commads;
|
||||
pub mod commands;
|
||||
pub mod callback_data;
|
||||
|
||||
use std::time::Duration;
|
||||
@@ -27,7 +27,7 @@ use crate::{
|
||||
types::{CachedMessage, DownloadFile}, download_file_by_link, get_download_link,
|
||||
},
|
||||
book_library::{get_book, get_author_books_available_types, get_translator_books_available_types, get_sequence_books_available_types},
|
||||
donation_notificatioins::send_donation_notification, user_settings::get_user_or_default_lang_codes, batch_downloader::{TaskObjectType, CreateTaskData},
|
||||
donation_notifications::send_donation_notification, user_settings::get_user_or_default_lang_codes, batch_downloader::{TaskObjectType, CreateTaskData},
|
||||
batch_downloader::{create_task, get_task, TaskStatus}
|
||||
|
||||
},
|
||||
@@ -38,7 +38,7 @@ use crate::{
|
||||
bots_manager::BotCache,
|
||||
};
|
||||
|
||||
use self::{callback_data::{CheckArchiveStatus, DownloadQueryData}, commads::{StartDownloadCommand, DownloadArchiveCommand}};
|
||||
use self::{callback_data::{CheckArchiveStatus, DownloadQueryData}, commands::{StartDownloadCommand, DownloadArchiveCommand}};
|
||||
|
||||
use super::utils::filter_command;
|
||||
|
||||
@@ -179,7 +179,6 @@ async fn send_download_link(
|
||||
.reply_markup(InlineKeyboardMarkup {
|
||||
inline_keyboard: vec![],
|
||||
})
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
@@ -400,7 +399,6 @@ async fn wait_archive(
|
||||
.reply_markup(InlineKeyboardMarkup {
|
||||
inline_keyboard: vec![],
|
||||
})
|
||||
.send()
|
||||
.await;
|
||||
log::error!("{:?}", err);
|
||||
return Err(err);
|
||||
@@ -459,7 +457,7 @@ async fn download_archive(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_download_hander() -> crate::bots::BotHandler {
|
||||
pub fn get_download_handler() -> crate::bots::BotHandler {
|
||||
dptree::entry()
|
||||
.branch(
|
||||
Update::filter_message()
|
||||
|
||||
Reference in New Issue
Block a user