augustjune/canoe

Add an ability to expect callback query

mikabele opened this issue · 0 comments

Hello, guys. I see among the open issues a topic with the possibility of waiting for a message to be entered after receiving a callback. I will try to explain it in more details. What is the main problem? Sometimes I need to expect input message from the user after he has selected one of the options in the inline keyboard. It means that firstly I need to expect CallbackButtonSelected update and then MessageReceived update in one Scenario. Right now I can't do it. I'll give you an example from a bot I'm working on right now. I want to create a bot which will help students to take place in a queue for various exams(like queue for doctor but for teacher in university). I have a command "Take place". What is the flow? - 1. select a teacher from the list 2. enter the date 3. choose a place from the list of available places. Flow looks like CallbackButtonSelected -> MessageReceived -> CallbackButtonSelected. Right now your API allows build flows only with MessageReceived updates. It is not suitable! I need to store intermediate data(for example date about previous selected buttons) in CallbackData to pass it from one callback handler to another (or use other approaches such as,for example, Redis). The second problem is that I need to wait until the button selected in most cases and it means suspend scenario flow.
In my project I slightly modified your library to have an ability to build such flows. I think it would be nice to add feature to expect callback answers in scenarios.
if you think my idea is correct, then I can share a little more details in this topic.
Thanks in advance