nestjs-telegraf icon indicating copy to clipboard operation
nestjs-telegraf copied to clipboard

How to use wizard with composer?

Open EizFeren opened this issue 1 year ago • 1 comments

I want to make wizard same as example below, but using nestjs-telegraf decorators. Is it possible?

const stepHandler = new Composer<Scenes.WizardContext>();

stepHandler.command('next', (ctx) => {
  ctx.wizard.next();
});

const wizard = new Scenes.WizardScene(
  'wizard',
  (ctx) => {
    ctx.wizard.next();
  },
  stepHandler,
  async (ctx) => {
    await ctx.scene.leave();
  },
);

EizFeren avatar Nov 27 '23 16:11 EizFeren

I had to override the registerScenes method to solve this issue

BARTlab avatar Mar 06 '24 13:03 BARTlab