handle edit command in any case

This commit is contained in:
Akulij 2025-04-10 20:12:15 +09:00
parent 4a37792c0c
commit a9919a9307

View File

@ -103,7 +103,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.enter_dialogue::<Message, PostgresStorage<Json>, State>() .enter_dialogue::<Message, PostgresStorage<Json>, State>()
.branch( .branch(
Update::filter_message() Update::filter_message()
.filter(|msg: Message| msg.text().unwrap_or("") == "edit") .filter(|msg: Message| msg.text().unwrap_or("").to_lowercase().as_str() == "edit")
.endpoint(edit_msg_cmd_handler), .endpoint(edit_msg_cmd_handler),
) )
.branch(dptree::case![State::Edit { literal, lang }].endpoint(edit_msg_handler)), .branch(dptree::case![State::Edit { literal, lang }].endpoint(edit_msg_handler)),