title: How to repeat a function and handler untill the user gives a valid reply to telegram bot?
body: <p>I just got into learning to build telegram bot using telegram-bot-api-python module. I made three functions one <code>/start</code> command function to start converstaion and this function asks for user phone number and send it to other handler or function called <code>reply_with_number</code> where the reply of user will be vaidated using <code>if</code> <code>else</code> statements and if the user reply is valid then he will be sent to another handler or function called <code>ask_link</code> this is the last one and he will reply me with a link. Everything is fine but when the user enters some string like &quot;<code>thisstring</code>&quot; instead of phone number then the function <code>reply_with_number</code> should keep running or keep asking for valid phone number untill he types valid one. But mine is just getting out of that <code>reply_with_number</code> and running the next <code>ask_link</code> handler without waiting for reply. How can solve this problem ?
  <strong>My code:</strong></p>
  <pre><code>import time
  from telegram import MessageEntity,Bot
  from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, ConversationHandler
  from telegram import KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove
  
  updater = Updater(token=token, use_context=True)
  dispatcher = updater.dispatcher
  
  def start(update, context):
      username = update.message.from_user.first_name
      context.bot.send_message(chat_id=update.effective_chat.id,
                               text=f&quot;Hello {username}, Welcome to my bot!&quot;)
      context.bot.send_message(chat_id=update.effective_chat.id,
                               text='May i know your phone no ?')
  
  def reply_with_number(update, context):
          if update.message.text and len(update.message.text) &lt;= 13:
              try:
                  if update.message.text[0:3] == '+91':
                      phone_number = int(update.message.text[3:])
                  elif update.message.text[0:2] == '91':
                      phone_number = int(update.message.text[2:])
                  elif update.message.text[0] == '0':
                      phone_number = int(update.message.text[1:])
                  else:
                      phone_number = int(update.message.text)
                      context.bot.send_message(chat_id=update.effective_chat.id,
                                               text='Looks good!',
                                               reply_markup=reply_markup)
              except Exception as e:
                  update.message.reply_text('Please enter phone number not strings!')
  
  def ask_link(update, context):
      link = update.message.text
      neat_url = strip(link)
      if neat_url != None:
          context.bot.send_message(chat_id=update.effective_chat.id,
                                   text='Link looks good')
      elif neat_url == None:
          context.bot.send_message(chat_id=update.effective_chat.id,
                                   text='Its invalid!')
  
  
  start_handler = CommandHandler('start', start)
  dispatcher.add_handler(start_handler)
  
  reply_handler = MessageHandler(Filters.contact | Filters.text, reply_with_number)
  dispatcher.add_handler(reply_handler)
  
  ask_for_link = MessageHandler(Filters.text, ask_link)
  dispatcher.add_handler(ask_for_link)
  
  updater.start_polling()
  </code></pre>
  <p>Screenshot of problem:
  <a href="https://i.stack.imgur.com/kQGJ4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kQGJ4.jpg" alt="enter image description here" /></a></p>