title: Telegram Bot API: How to get InlineKeyboardButton's text using CallbackQuery.data?
body: <p>I am coding a Telegram bot in Python and was wondering how I could get or store the value of the &quot;text&quot; key when I press a button in in my bot instance. As I want to use it to adapt the displayed message in the next called function (I hope that it's clear...)</p>
  <p>My current code is this:</p>
  <pre class="lang-py prettyprint-override"><code>def live_main(update: Update, context: CallbackContext) -&gt; None:
      query = update.callback_query
      query.answer()
      keyboard = [
          [
              InlineKeyboardButton(&quot;1&quot;, callback_data=str(LIVE)),
              InlineKeyboardButton(&quot;2&quot;, callback_data=str(LIVE))      
          ],
          [InlineKeyboardButton(&quot;Back&quot;, callback_data=str(STARTOVER))]
      ]   
      reply_markup = InlineKeyboardMarkup(keyboard)
      query.edit_message_text(
          text=&quot;How many people will attend the live session?&quot;, reply_markup=reply_markup
      )
      return FIRST
  
  def live(update: Update, context: CallbackContext) -&gt; None:
      query = update.callback_query
      query.answer()
      keyboard = [
          [InlineKeyboardButton(&quot;Btc&quot;, callback_data=str(PAYLIVE))],
          [InlineKeyboardButton(&quot;Paypal&quot;, callback_data=str(PAYLIVE))],
          [InlineKeyboardButton(&quot;Back&quot;, callback_data=str(LIVEM))]
      ]    
      reply_markup = InlineKeyboardMarkup(keyboard)   
      query.edit_message_text(
          text=&quot;Price for {**CallbackQuery.text**} { is {price_live/**CallbackQuery.text**)} USD or the equivalent in crypto-currencies. Please, choose your payment method. (And to be perfectly honest, we prefer crypto...)&quot;, reply_markup=reply_markup
      )
      return FIRST
  </code></pre>
  <p>So as you can see, I want to use either the &quot;1&quot; or &quot;2&quot; value from the live_main function inside the live function (where I put the <strong>CallbackQuery.text</strong> placeholders).
  I hope someone can help.
  Regards</p>