create /setchat command
This commit is contained in:
parent
da1940cf23
commit
adac0155b9
@ -31,6 +31,8 @@ pub enum AdminCommands {
|
|||||||
EditButton,
|
EditButton,
|
||||||
/// Set specified literal value
|
/// Set specified literal value
|
||||||
SetLiteral { literal: String },
|
SetLiteral { literal: String },
|
||||||
|
/// Sets chat where this message entered as support's chats
|
||||||
|
SetChat,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn admin_command_handler(
|
pub async fn admin_command_handler(
|
||||||
@ -93,6 +95,13 @@ pub async fn admin_command_handler(
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
AdminCommands::SetChat => {
|
||||||
|
dialogue.exit().await?;
|
||||||
|
db.set_literal("support_chat_id", &msg.chat.id.0.to_string())
|
||||||
|
.await?;
|
||||||
|
bot.send_message(msg.chat.id, "ChatId is set!").await?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user