Added export handler macro
This commit is contained in:
parent
42088e69fe
commit
b415277769
@ -1,16 +1,6 @@
|
||||
//! This module consists of endpoints to handle callbacks
|
||||
|
||||
mod decrypt;
|
||||
mod delete;
|
||||
mod delete_message;
|
||||
mod get;
|
||||
mod get_menu;
|
||||
|
||||
pub use decrypt::decrypt;
|
||||
pub use delete::delete;
|
||||
pub use delete_message::delete_message;
|
||||
pub use get::get;
|
||||
pub use get_menu::get_menu;
|
||||
crate::export_handlers!(decrypt, delete, delete_message, get, get_menu);
|
||||
|
||||
use crate::errors::InvalidCommand;
|
||||
use base64::{engine::general_purpose::STANDARD_NO_PAD as B64_ENGINE, Engine as _};
|
||||
|
@ -1,32 +1,20 @@
|
||||
//! This module consists of endpoints to handle commands
|
||||
|
||||
mod add_account;
|
||||
mod cancel;
|
||||
mod delete;
|
||||
mod delete_all;
|
||||
mod export;
|
||||
mod gen_password;
|
||||
mod get_account;
|
||||
mod get_accounts;
|
||||
mod help;
|
||||
mod import;
|
||||
mod menu;
|
||||
mod set_master_pass;
|
||||
mod start;
|
||||
|
||||
pub use add_account::add_account;
|
||||
pub use cancel::cancel;
|
||||
pub use delete::delete;
|
||||
pub use delete_all::delete_all;
|
||||
pub use export::export;
|
||||
pub use gen_password::gen_password;
|
||||
pub use get_account::get_account;
|
||||
pub use get_accounts::get_accounts;
|
||||
pub use help::help;
|
||||
pub use import::import;
|
||||
pub use menu::menu;
|
||||
pub use set_master_pass::set_master_pass;
|
||||
pub use start::start;
|
||||
crate::export_handlers!(
|
||||
add_account,
|
||||
cancel,
|
||||
delete,
|
||||
delete_all,
|
||||
export,
|
||||
gen_password,
|
||||
get_account,
|
||||
get_accounts,
|
||||
help,
|
||||
import,
|
||||
menu,
|
||||
set_master_pass,
|
||||
start
|
||||
);
|
||||
|
||||
use teloxide::macros::BotCommands;
|
||||
|
||||
|
@ -71,3 +71,14 @@ macro_rules! simple_state_handler {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! export_handlers {
|
||||
($($name: ident),*) => {
|
||||
$(
|
||||
mod $name;
|
||||
pub use $name::$name;
|
||||
)
|
||||
*
|
||||
};
|
||||
}
|
||||
|
@ -1,22 +1,19 @@
|
||||
//! This module consists of endpoints to handle the state
|
||||
|
||||
mod generic;
|
||||
mod get_login;
|
||||
mod get_master_pass;
|
||||
mod get_new_master_pass;
|
||||
mod get_new_name;
|
||||
mod get_password;
|
||||
mod get_user;
|
||||
mod handler;
|
||||
|
||||
pub use get_login::get_login;
|
||||
pub use get_master_pass::get_master_pass;
|
||||
pub use get_new_master_pass::get_new_master_pass;
|
||||
pub use get_new_name::get_new_name;
|
||||
pub use get_password::get_password;
|
||||
pub use get_user::get_user;
|
||||
pub use handler::{Handler, MessageIds, PackagedHandler};
|
||||
|
||||
crate::export_handlers!(
|
||||
get_login,
|
||||
get_master_pass,
|
||||
get_new_master_pass,
|
||||
get_new_name,
|
||||
get_password,
|
||||
get_user
|
||||
);
|
||||
|
||||
use crate::prelude::*;
|
||||
use teloxide::dispatching::dialogue::InMemStorage;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user