now changing state in set_master_pass by using change_state macro

This commit is contained in:
2023-07-27 01:38:17 +03:00
parent 22c754a256
commit 426a4736ce
3 changed files with 21 additions and 29 deletions

View File

@ -1,4 +1,4 @@
use crate::prelude::*;
use crate::{change_state, prelude::*};
use tokio::task::spawn_blocking;
/// Actually sets the master password
@ -41,13 +41,12 @@ pub async fn set_master_pass(
let previous = bot
.send_message(msg.chat.id, "Send new master password")
.await?;
dialogue
.update(State::GetNewMasterPass(Handler::new(
|bot, msg, db, dialogue, ids, master_pass| {
Box::pin(get_master_pass(bot, msg, db, dialogue, ids, master_pass))
},
MessageIds::from(&previous),
)))
.await?;
Ok(())
change_state!(
dialogue,
previous,
(),
State::GetNewMasterPass,
get_master_pass
)
}