title: Updating messages with inline keyboards using callback queries
body: <p>I want to update message in chat with inline keyboard but can't understand how to receive a <em>inline_message_id</em> or if it only for inline queries how I can determine <em>chat_id</em> and <em>message_id</em> for using it on <a href="https://pythonhosted.org/python-telegram-bot/telegram.bot.html" rel="nofollow">editMessageText(*args, **kwargs)</a> in class <em>telegram.bot.Bot</em>?</p>
  
  <p>my code example (part of it):</p>
  
  <pre><code>#!/usr/bin/python
  import telegram
  from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, InlineQueryHandler, CallbackQueryHandler
  
  tokenid = "YOUR_TOKEN_ID"
  
  def inl(bot, update):
      if update.callback_query.data == "k_light_on":
          #func for turn on light res = k_light.on()
          bot.answerCallbackQuery(callback_query_id=update.callback_query.id, text="Turning on light ON!")
          bot.editMessageText(inline_message_id=update.callback_query.inline_message_id, text="Do you want to turn On or Off light? Light is ON")
          #hardcoded vars variant
          #bot.editMessageText(message_id=298, chat_id=174554240, text="Do you want to turn On or Off light? Light is ON")
      elif update.callback_query.data == "k_light_off":
          #func for turn on light res = k_light.off()
          bot.answerCallbackQuery(callback_query_id=update.callback_query.id, text="Turning off light OFF!")
          bot.editMessageText(inline_message_id=update.callback_query.inline_message_id, text="Do you want to turn On or Off light? Light is ON")
          #hardcoded vars variant
          #bot.editMessageText(message_id=298, chat_id=174554240, text="Do you want to turn On or Off light? Light is OFF")
      else:
          print "Err"
  
  def k_light_h(bot, update):
      reply_markup = telegram.InlineKeyboardMarkup([[telegram.InlineKeyboardButton("On", callback_data="k_light_on"), telegram.InlineKeyboardButton("Off", callback_data="k_light_off")]])
      ddd = bot.sendMessage(chat_id=update.message.chat_id, text="Do you want to turn On or Off light?", reply_markup=reply_markup)
  
  if __name__ == "__main__":
      #
      updater = Updater(token=tokenid)
      ### Handler groups
      dispatcher = updater.dispatcher
      # light
      k_light_handler = CommandHandler('light', k_light_h)
      dispatcher.add_handler(k_light_handler)
      # errors
      updater.dispatcher.add_error_handler(error)
      updater.start_polling()
      # Run the bot until the user presses Ctrl-C or the process receives SIGINT,
      # SIGTERM or SIGABRT
      updater.idle()
  </code></pre>
  
  <p>When I run it I have an error:</p>
  
  <pre><code>telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
  root - WARNING - Update ...
  ... caused error "u'Bad Request: message identifier is not specified'"
  </code></pre>
  
  <p>I checked var <em>update.callback_query.inline_message_id</em> and it was empty. When I tried <em>bot.editMessageText</em> with hardcoded vars <em>chat_id</em> and <em>message_id</em> it worked well.</p>
  
  <p>Do I need save in DB (for all users) vars <em>chat_id</em> and <em>message_id</em> when  they run command /light and then when they press inline button I need read from DB this value or I can use some simpler method for editing messages?</p>