How to implement a Telegram bot program that could handle multiple steps of input?
<p>I'm programming a telegram bot in Python3 using the Telegram bot API. I'm facing the problem of handling requests that need multiple steps to couplet. 
For example, for an airline search bot:</p>

<ol>
<li>the bot ask for departure city, </li>
<li>the user input a name,</li>
<li>the bot ask for destination,</li>
<li>the user input another name,</li>
<li>after a bunch of questions, the bot returns the result to the user.</li>
</ol>

<p>What can I do?</p>

<p>You need to have a question tree that users can traverse it. you can use a linked list for it and saved this tree in the database. For each question there is a method that take some actions (like store in database) and send a question/result to the user. Each user has a <code>CurrentState</code> that contain state of user in the question tree. User sent an answer to the bot and the bot will run corresponding method and responds to the user.</p>

<pre><code>method = //Fetch user CurrentState from db e.g. airlineBot.doSomething
method(TelegramMessage)
</code></pre>

python api python-3.x telegram