2023-05-09 17:27:58 +00:00
|
|
|
//! This module consists of endpoints to handle the state
|
|
|
|
|
2023-05-03 18:08:14 +00:00
|
|
|
mod generic;
|
2023-06-04 15:46:59 +00:00
|
|
|
mod get_existing_name;
|
2023-05-03 18:08:14 +00:00
|
|
|
mod get_login;
|
|
|
|
mod get_master_pass;
|
2023-06-04 15:46:59 +00:00
|
|
|
mod get_new_name;
|
2023-05-03 18:08:14 +00:00
|
|
|
mod get_password;
|
2023-05-27 23:21:50 +00:00
|
|
|
mod get_user;
|
2023-05-23 18:09:28 +00:00
|
|
|
mod handler;
|
2023-05-03 18:08:14 +00:00
|
|
|
|
2023-06-04 15:46:59 +00:00
|
|
|
pub use get_existing_name::get_existing_name;
|
2023-05-03 18:08:14 +00:00
|
|
|
pub use get_login::get_login;
|
|
|
|
pub use get_master_pass::get_master_pass;
|
2023-06-04 15:46:59 +00:00
|
|
|
pub use get_new_name::get_new_name;
|
2023-05-03 18:08:14 +00:00
|
|
|
pub use get_password::get_password;
|
2023-05-27 23:21:50 +00:00
|
|
|
pub use get_user::get_user;
|
2023-05-23 18:09:28 +00:00
|
|
|
pub use handler::{Handler, PackagedHandler};
|
2023-05-27 23:21:50 +00:00
|
|
|
|
|
|
|
use crate::models::User;
|
|
|
|
use teloxide::{dispatching::dialogue::InMemStorage, prelude::*};
|
|
|
|
|
|
|
|
#[derive(Default, Clone)]
|
|
|
|
pub enum State {
|
|
|
|
#[default]
|
|
|
|
Start,
|
2023-06-04 15:46:59 +00:00
|
|
|
GetExistingName(PackagedHandler<String>),
|
|
|
|
GetNewName(PackagedHandler<String>),
|
2023-05-27 23:21:50 +00:00
|
|
|
GetMasterPass(PackagedHandler<String>),
|
|
|
|
GetLogin(PackagedHandler<String>),
|
|
|
|
GetPassword(PackagedHandler<String>),
|
|
|
|
GetUser(PackagedHandler<User>),
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type MainDialogue = Dialogue<State, InMemStorage<State>>;
|