robot-mafia / nestjs-telegraf

🤖 Powerful Nest module for easy and fast creation Telegram bots
https://nestjs-telegraf.0x467.com
MIT License
527 stars 89 forks source link

How to use wizard with composer? #1168

Closed EizFeren closed 3 months ago

EizFeren commented 11 months ago

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();
  },
);
BARTlab commented 8 months ago

I had to override the registerScenes method to solve this issue