From c2aebcd509d99ec4cc4edace0e33cfb46fdb162b Mon Sep 17 00:00:00 2001 From: Akulij Date: Mon, 5 May 2025 18:46:05 +0300 Subject: [PATCH] create /cancel admin command --- src/admin.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/admin.rs b/src/admin.rs index 8956e15..2922141 100644 --- a/src/admin.rs +++ b/src/admin.rs @@ -39,6 +39,8 @@ pub enum AdminCommands { SetChat, /// Shows user count and lists some of them Users, + /// Cancel current action and sets user state to default + Cancel, } pub async fn admin_command_handler( @@ -148,6 +150,12 @@ pub async fn admin_command_handler( Ok(()) } + AdminCommands::Cancel => { + dialogue.exit().await?; + bot.send_message(msg.chat.id, "canceled current action") + .await?; + Ok(()) + } } }