diff --git a/src/admin.rs b/src/admin.rs index 8477e44..9fd0b77 100644 --- a/src/admin.rs +++ b/src/admin.rs @@ -3,11 +3,11 @@ use teloxide::{ utils::{command::BotCommands, render::RenderMessageTextHelper}, }; -use crate::LogMsg; use crate::{ db::{CallDB, DB}, BotResult, }; +use crate::{BotDialogue, LogMsg, State}; use log::info; // These are should not appear in /help @@ -27,6 +27,8 @@ pub enum AdminCommands { Pin, /// Removes your admin privileges Deop, + /// Send command and then click button to edits text in it + EditButton, } pub async fn admin_command_handler( @@ -34,6 +36,7 @@ pub async fn admin_command_handler( bot: Bot, msg: Message, cmd: AdminCommands, + dialogue: BotDialogue, ) -> BotResult<()> { let tguser = match msg.from.clone() { Some(user) => user, @@ -69,6 +72,12 @@ pub async fn admin_command_handler( .await?; Ok(()) } + AdminCommands::EditButton => { + dialogue.update(State::EditButton).await?; + bot.send_message(msg.chat.id, "Click button which text should be edited") + .await?; + Ok(()) + } } } diff --git a/src/main.rs b/src/main.rs index fe54ee5..d844d44 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,6 +71,7 @@ pub enum State { lang: String, is_caption_set: bool, }, + EditButton, } #[derive(Serialize, Deserialize)] @@ -432,6 +433,7 @@ fn command_handler( user.map(|u| u.is_admin).unwrap_or(false) }) .filter_command::() + .enter_dialogue::, State>() .endpoint(admin_command_handler), ) }