As the telegram bot to do the feedback?

The crux of the matter:
has bot, for example a command /feedback usiku sent a message:
Email your suggestions or comments. Enter /cancel to cancel.

And then he writes either /cancel(or in the message body shakes) or it writes the text that would be formed in the database.
July 8th 19 at 12:04
1 answer
July 8th 19 at 12:06
It is necessary to capture and store the current user state.
When the user clicks/calls a command /feedback of the bot transfer to the idle state and recording of everything that enters the user in addition to the /cancel (if the command in the text was held, that do not retain).

1. Keep state
2. Depending on the state change logic
OK thanks - Jody26 commented on July 8th 19 at 12:09
can you please try to clarify how to do it better in php (though I have no option can't imagine) - Nathanial_Rath50 commented on July 8th 19 at 12:12

Find more questions by tags PHPTelegram