-
Hello everyone I am studying teloxide and trying to implement transitions in various dialog states. I took this exercise as a basis for an example https://github.com/teloxide/teloxide/blob/master/crates/teloxide/examples/purchase.rs
` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
First of all, revoke your bot token from botfather, don't publish it again, because through it you can fully control the bot. You already has a message filter, so it will filter all the coming messages, and the one you created will not be considered. So you must add your new cases to it like this let message_handler = Update::filter_message()
.branch(command_handler)
.branch(case![State::ReceiveFullName].endpoint(receive_full_name))
.branch(case![State::ReceiveFullName2].endpoint(receive_full_name_2))
.branch(case![State::AnotherState].endpoint(another_state))
.branch(dptree::endpoint(invalid_state)); And remove your new handler, also you need to await the send message request like this -bot.send_message(msg.chat.id, "test_2");
+bot.send_message(msg.chat.id, "test_2").await; Also is better to send a message to the user before update the dialogue state, for example send to the user "Send your second full name" and then update the dialogue. |
Beta Was this translation helpful? Give feedback.
First of all, revoke your bot token from botfather, don't publish it again, because through it you can fully control the bot.
You already has a message filter, so it will filter all the coming messages, and the one you created will not be considered. So you must add your new cases to it like this
And remove your new handler, also you need to await the send message…