title: Telegram bot using Telegraf in Node.js question
body: <p>I'm still pretty new to Node.js,
  I'm trying to make a bot that prompts the user to search a word and then looks in a MySQL db for matching rows.
  The search process should be divided in 2 steps:</p>
  <ol>
  <li>User is asked to chose an option via inline keyboard, only then;</li>
  <li>User is asked to write the word to search for.</li>
  </ol>
  <p>Bot should search database in the table selected by option in step 1 for the word entered in step 2 and retrive the row.
  Also the bot should handle multiple users.
  I've tried using Wizards but as there isn't a lot of documentation I'm not able to handle inline keyboard callbacks.
  Sql part isn't much of a problem, I'm using npm &quot;mysql&quot;.</p>
  <p>Here's the code I've come up with:</p>
  <pre><code>const { Telegraf } = require('telegraf');
  const session = require('telegraf/session');
  const Stage = require('telegraf/stage');
  const WizardScene = require('telegraf/scenes/wizard');
  const bot = new Telegraf('token-here');
  
  bot.start( (ctx) =&gt; {
      ctx.reply('Bot started!');
  })
  
  const menuKeyboard = [
      [
          {text: 'OPT1', callback_data: 'CB_OPT1'},
          {text: 'OPT2', callback_data: 'CB_OPT2'},
          {text: 'OPT3', callback_data: 'CB_OPT3'}
      ],
      [
          {text: 'OPT4', callback_data: 'CB_OPT4'},
          {text: 'OPT5', callback_data: 'CB_OPT5'},
          {text: 'OPT6', callback_data: 'CB_OPT6'}
      ]
  ]
  
  bot.action(['CB_OPT1', 'CB_OPT2', 'CB_OPT3', 'CB_OPT4', 'CB_OPT5', 'CB_OPT6'], (ctx) =&gt; {
      ctx.deleteMessage();
      ctx.reply(`Insert search term:`);
      return ctx.wizard.steps[1](ctx); //Re-enters wizard?
  })
  
  //Wizzard setup
  const superWizard = new WizardScene('super-wizard',
      //Step 1 - Ask option
      ctx =&gt; {
          ctx.reply(&quot;Select an option:&quot;, {
              reply_markup: {
                  inline_keyboard: menuKeyboard
              }
          });
          ctx.wizard.state.data = {};
          return ctx.wizard.next();
          //Callback calls bot.action above
      },
  
      ctx =&gt; {
          ctx.deleteMessage();
          ctx.wizard.state.data.option = ctx.message.text;
      }
  );
  
  const stage = new Stage([superWizard]);
  
  bot.use(session());
  bot.use(stage.middleware());
  
  bot.command('search', (ctx) =&gt; {
      //ctx.scene.enter('super-wizard');
      ctx.reply(&quot;Select an option:&quot;, {
          reply_markup: {
              inline_keyboard: menuKeyboard
          }
      });
  })
  
  bot.launch();
  </code></pre>
  <p>Is using wizards the best approach?
  Thanks!, I've just started out :)</p>