title: Telegram bot to wait for user reply
body: <p>The code below is for a <strong>Telegram Bot</strong> which basically takes a person <strong>username</strong> and <strong>password</strong> and verifies it to provide his average expenditures. </p>
  
  <p>The problem as we see is the bot waits for the user to send his username and password for <strong>10 sec</strong> either waste of time (or) not sufficient time was given. How could I program such that the bot waits for user message and then executes the next lines ( wait till the trigger )</p>
  
  <pre><code>def highest(intent,chatid,text):
      seq=["What is your Username ?","Password?"]
      send_message(seq[0],chatid)
      time.sleep(6)
      name,chatid = reply_function()
      print name
      send_message(seq[1],chatid)
      time.sleep(6)
      pw,chatid = reply_function()
      print pw
      try:
          flag = obj.validate(name,pw)
          if flag=="Verified":
              for i in obj.avg_transactions():
                  send_message(i,chatid)
          else:
              send_message("try again",chatid)
              highest(intent,chatid,text)
       except:
          send_message("try again",chatid)
          highest(intent,chatid,text)
  </code></pre>