From ef0ccfb45711b90f294654eb1e4fb36674c3056a Mon Sep 17 00:00:00 2001 From: StNicolay Date: Sun, 28 May 2023 02:00:12 +0300 Subject: [PATCH] Simplified the default endpoint --- src/handlers/commands/mod.rs | 2 -- src/handlers/{commands => }/default.rs | 0 src/handlers/mod.rs | 5 +++-- 3 files changed, 3 insertions(+), 4 deletions(-) rename src/handlers/{commands => }/default.rs (100%) diff --git a/src/handlers/commands/mod.rs b/src/handlers/commands/mod.rs index 963fb31..64cab9e 100644 --- a/src/handlers/commands/mod.rs +++ b/src/handlers/commands/mod.rs @@ -2,7 +2,6 @@ mod add_account; mod cancel; -mod default; mod delete; mod delete_all; mod export; @@ -16,7 +15,6 @@ mod start; pub use add_account::add_account; pub use cancel::cancel; -pub use default::default; pub use delete::delete; pub use delete_all::delete_all; pub use export::export; diff --git a/src/handlers/commands/default.rs b/src/handlers/default.rs similarity index 100% rename from src/handlers/commands/default.rs rename to src/handlers/default.rs diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 99ce8b4..69b911d 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -1,5 +1,6 @@ mod callbacks; mod commands; +mod default; mod markups; mod master_password_check; mod state; @@ -32,7 +33,7 @@ pub fn get_dispatcher( token: String, db: DatabaseConnection, ) -> Dispatcher, crate::Error, teloxide::dispatching::DefaultKey> { - use dptree::{case, deps, endpoint}; + use dptree::{case, deps}; let bot = Bot::new(token).throttle(Limits::default()); @@ -61,7 +62,7 @@ pub fn get_dispatcher( .branch(case![State::GetPassword(next)].endpoint(state::get_password)) .branch(case![State::GetDocument(next)].endpoint(state::get_document)) .branch(command_handler) - .branch(endpoint(commands::default)); + .endpoint(default::default); let callback_handler = Update::filter_callback_query().chain(callbacks::delete_message::get_handler());