Mohammad Jan,
You should do it yourself. I suggest you to store the chats in a database table and then store the next command in a column for each chat.
Lets say after /start
you're looking for the name of user so you will store /name
into the next_command column and whenever you receive a normal message without any /command
, then you can check the next_command column and consider the message received as an answer to "What's your name?" question.
You can continue this process to get the full data from the user. For example after getting the name you can ask "How old are you?" and change next_command
to /old
and then consider the next message as an answer for the previous question.
BTW, It's just a suggestion. You should be able to find the way that is suitable for you. But what is obvious, you should do it yourself since telegram only provide messages to your bot and it's your bot that manage them.
Hope it helps.