0

My wizard scene only works after I comment on the bot.on('txt') handler

bot.on('text', async (ctx) => {
    try {
        switch (ctx.message.text) {//my code}
    } catch (e) {
        console.error(e)
    }
})

My handler for wizard-scene

stepHandler.on('text', async (ctx) => {
  await ctx.reply('Step 2. Via command')
  return ctx.wizard.next()
})

Please advise how to solve this problem

1 Answers1

0

i think you need to collect data from user, you just log the context on your code then simply de-structure the data like which you want

ex:

bot.start(async (ctx) => {
    console.log(ctx.message.chat);
    ctx.telegram.sendMessage(ctx.chat.id, `hello ${ctx.chat.username} `);
})
Viyas
  • 1
  • 1