diff --git a/src/bots/approved_bot/modules/download/mod.rs b/src/bots/approved_bot/modules/download/mod.rs index dd14a2e..6373cee 100644 --- a/src/bots/approved_bot/modules/download/mod.rs +++ b/src/bots/approved_bot/modules/download/mod.rs @@ -137,14 +137,9 @@ async fn send_with_download_from_channel( ) -> BotHandlerInternal { match download_file(&download_data).await { Ok(v) => { - match _send_downloaded_file(&message, bot.clone(), v).await { - Ok(_) => (), - Err(err) => { - log::error!("{:?}", err); - - send_download_link(message.clone(), bot.clone(), download_data).await?; - return Ok(()); - }, + if let Err(_) = _send_downloaded_file(&message, bot.clone(), v).await { + send_download_link(message.clone(), bot.clone(), download_data).await?; + return Ok(()); }; if need_delete_message { diff --git a/src/bots/approved_bot/modules/help/commands.rs b/src/bots/approved_bot/modules/help/commands.rs new file mode 100644 index 0000000..fdf1493 --- /dev/null +++ b/src/bots/approved_bot/modules/help/commands.rs @@ -0,0 +1,9 @@ +use teloxide::utils::command::BotCommands; + + +#[derive(BotCommands, Clone)] +#[command(rename_rule = "lowercase")] +pub enum HelpCommand { + Start, + Help, +} diff --git a/src/bots/approved_bot/modules/help.rs b/src/bots/approved_bot/modules/help/mod.rs similarity index 86% rename from src/bots/approved_bot/modules/help.rs rename to src/bots/approved_bot/modules/help/mod.rs index be9a858..4205fbf 100644 --- a/src/bots/approved_bot/modules/help.rs +++ b/src/bots/approved_bot/modules/help/mod.rs @@ -1,13 +1,10 @@ +pub mod commands; + use crate::bots::BotHandlerInternal; -use teloxide::{prelude::*, utils::command::BotCommands, types::ParseMode, adaptors::{Throttle, CacheMe}}; +use teloxide::{prelude::*, types::ParseMode, adaptors::{Throttle, CacheMe}}; -#[derive(BotCommands, Clone)] -#[command(rename_rule = "lowercase")] -enum HelpCommand { - Start, - Help, -} +use self::commands::HelpCommand; pub async fn help_handler(message: Message, bot: CacheMe>) -> BotHandlerInternal {