title: How to store a button clicked as string using inline keyboard for telegram bot python
body: <pre><code>markup = types.InlineKeyboardMarkup()
  markup.add(types.InlineKeyboardButton(text='option 1', callback_data='1'))
  markup.add(types.InlineKeyboardButton(text='option 2', callback_data='2'))
  bot.send_message(message.chat.id, f&quot;text: {message.text}\n\nnow please choose a label&quot;,reply_markup=markup)
  query = Update.callback_query.inline_message_id.text
  print(query)
  </code></pre>
  <p>I get this error:</p>
  <blockquote>
  <p>AttributeError: type object 'Update' has no attribute 'callback_query'</p>
  </blockquote>
  <p>Expected output is</p>
  <p>Print the text of whatever button is pressed</p>
  <p><a href="https://python-telegram-bot.readthedocs.io/en/stable/telegram.callbackquery.html" rel="nofollow noreferrer">https://python-telegram-bot.readthedocs.io/en/stable/telegram.callbackquery.html</a></p>
  <p>I believe my case is <code>inline_message_id</code> as the buttons are attached to the bot message.</p>
  <p>Thanks.</p>