title: Telegraf Markup inline keyboard doesn't work as expected
body: <p>I created a simple item price tracker bot with NodeJS and Telegraf npm library. It includes step wizard and markup inline keyboard. When I press any inline keyboard button 1st time it doesn't call pre-configured action and it does at 2nd attempt only (see pictures below).</p>
  <p>1st click
  <a href="https://i.stack.imgur.com/eXeB3.png" rel="nofollow noreferrer">https://i.stack.imgur.com/eXeB3.png</a></p>
  <p>2nd click
  <a href="https://i.stack.imgur.com/JIn1H.png" rel="nofollow noreferrer">https://i.stack.imgur.com/JIn1H.png</a></p>
  <pre><code>const Telegraf = require('telegraf')
  const bot = new Telegraf(process.env.TELEGRAM_API)
  const Composer = require('telegraf/composer')
  const Stage = require('telegraf/stage')
  const WizardScene = require('telegraf/scenes/wizard')
  const Markup = require('telegraf/markup')
  const session = require('telegraf/session')
  
  const items = []
  let id
  let email
  let item
  let price
  
  const itemSelector = new Composer()
  itemSelector.action(&quot;item1&quot;, (ctx) =&gt; {
      item = &quot;Item 1&quot;
      return ctx.wizard.next()
  })
  itemSelector.action(&quot;item2&quot;, (ctx) =&gt; {
      item = &quot;Item 2&quot;
      return ctx.wizard.next()
  })
  itemSelector.action(&quot;item3&quot;, (ctx) =&gt; {
      item = &quot;Item 3&quot;
      return ctx.wizard.next()
  })
  itemSelector.action(&quot;item4&quot;, (ctx) =&gt; {
      item = &quot;Item 4&quot;
      return ctx.wizard.next()
  })
  
  const wizard = new WizardScene(
      &quot;scene&quot;,
      ctx =&gt; {
          id = ctx.from.id
          ctx.reply(&quot;Enter your email address&quot;)
          return ctx.wizard.next()
      },
      ctx =&gt; {
          email = ctx.message.text
          ctx.reply(&quot;Select the required gas price level&quot;, Markup.inlineKeyboard([
              Markup.callbackButton(&quot;Item 1&quot;, &quot;item1&quot;),
              Markup.callbackButton(&quot;Item 2&quot;, &quot;item2&quot;),
              Markup.callbackButton(&quot;Item 3&quot;, &quot;item3&quot;),
              Markup.callbackButton(&quot;Item 4&quot;, &quot;item4&quot;),
          ]).extra())
          return ctx.wizard.next()
      },
      itemSelector,
      ctx =&gt; {
          ctx.reply(&quot;Enter the required price&quot;)
          return ctx.wizard.next()
      },
      ctx =&gt; {
          price = parseFloat(ctx.message.text)
          items.push({ id, item, email })
          ctx.reply(`When the ${item} price will be equal or lower than ${price} alert will be send to ${email}`)
          return ctx.scene.leave()
      }
  )
  const stage = new Stage([wizard])
  bot.use(session())
  bot.use(stage.middleware())
  
  bot.start((ctx) =&gt; {
      ctx.scene.enter('scene')
  })
  
  bot.launch()
  </code></pre>