title: How do I answer only the latest user inline query with python-telegram-bot?
body: <p>I'm using <a href="https://github.com/python-telegram-bot/python-telegram-bot" rel="nofollow noreferrer">python-telegram-bot</a> to build a bot that answers to inline queries. The query result is kind of complex to process. I'm using <code>@run_async</code>.</p>
  
  <p>As a user types an inline query, the client produces several queries, every one of them spawning a handler on my bot that takes time to process.</p>
  
  <p>Of all of those queries, only the latest one is actually important. For example, if I query for "Beach Voley", the bot will receive successive queries for:</p>
  
  <ul>
  <li>Bea</li>
  <li>Beach</li>
  <li>Beach Vo</li>
  <li>Beach Voley</li>
  </ul>
  
  <p>as I type, pause and continue typing.</p>
  
  <p>Then, my bot lags processing the incomplete queries before processing the actually important one, and telegram gives me invalid id errors for the outdated ones, and timeout for the actually important query.</p>
  
  <p>I would like to, upon receive a query, cancel any other inline queries being processed for that user with an older timestamp, killing their threads or something.</p>
  
  <p>Telepot, another telegram bot library for python I used, had this included as a <a href="https://telepot.readthedocs.io/en/latest/reference.html#telepot.helper.Answerer" rel="nofollow noreferrer">feature</a>. From what I could understand of the source code, it keeps a running tasks queue internally.</p>
  
  <p>How could I mimic this behavior in python-telegram-bot? Is this a feaure that I'm just not finding?</p>