Simplified the default endpoint

This commit is contained in:
StNicolay 2023-05-28 02:00:12 +03:00
parent 1989283754
commit ef0ccfb457
Signed by: StNicolay
GPG Key ID: 9693D04DCD962B0D
3 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,6 @@
mod add_account; mod add_account;
mod cancel; mod cancel;
mod default;
mod delete; mod delete;
mod delete_all; mod delete_all;
mod export; mod export;
@ -16,7 +15,6 @@ mod start;
pub use add_account::add_account; pub use add_account::add_account;
pub use cancel::cancel; pub use cancel::cancel;
pub use default::default;
pub use delete::delete; pub use delete::delete;
pub use delete_all::delete_all; pub use delete_all::delete_all;
pub use export::export; pub use export::export;

View File

@ -1,5 +1,6 @@
mod callbacks; mod callbacks;
mod commands; mod commands;
mod default;
mod markups; mod markups;
mod master_password_check; mod master_password_check;
mod state; mod state;
@ -32,7 +33,7 @@ pub fn get_dispatcher(
token: String, token: String,
db: DatabaseConnection, db: DatabaseConnection,
) -> Dispatcher<Throttle<Bot>, crate::Error, teloxide::dispatching::DefaultKey> { ) -> Dispatcher<Throttle<Bot>, crate::Error, teloxide::dispatching::DefaultKey> {
use dptree::{case, deps, endpoint}; use dptree::{case, deps};
let bot = Bot::new(token).throttle(Limits::default()); 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::GetPassword(next)].endpoint(state::get_password))
.branch(case![State::GetDocument(next)].endpoint(state::get_document)) .branch(case![State::GetDocument(next)].endpoint(state::get_document))
.branch(command_handler) .branch(command_handler)
.branch(endpoint(commands::default)); .endpoint(default::default);
let callback_handler = let callback_handler =
Update::filter_callback_query().chain(callbacks::delete_message::get_handler()); Update::filter_callback_query().chain(callbacks::delete_message::get_handler());