question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to leave() from WizardScene?

See original GitHub issue

I tried bot.command("cancel", leave());, wizardName.command and .action. No action, just errors in console.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dobeermancommented, Nov 13, 2017

I’ve a more than 20 steps in my wizard. I think it’s a not good idea to add this logic to each one.

Would be better

const superWizard = new WizardScene('super-wizard',
  (ctx) => {
    ctx.reply('Step 1')
    ctx.wizard.next()
  },
  (ctx) => {
    ctx.reply('Step 2')
    ctx.wizard.next()
  },
  (ctx) => {
    ctx.reply('Done')
    ctx.scene.leave()
  }
)

superWizard.command("cancel", leave());
0reactions
dotcypresscommented, Nov 15, 2017

@dobeerman from next version, WizardScene will be compatible with Composer

Thank you for your time 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Telegraf.js: leave WizardScene with a button - Stack Overflow
leave ('super-wizard'); });. The program writes correctly the text, and puts the button. But if i press "CANCEL" it gives error at: ctx ......
Read more >
Telegraf Snipgram - Visual Studio Marketplace
Launch VS Code Quick Open ( Ctrl+P ), paste the following command, and press enter. Copy. Copied to clipboard. More Info ...
Read more >
telegraf - Bountysource
Hi there! Here I have a problem: I am on the some scene and lets say there is 4 stages so situatiots go...
Read more >
v4.11.2 Scenes WizardScene - Telegraf
Generates middleware for handling updates narrowed by update types or filter queries. Type Parameters. Ctx extends Context<Update, Ctx> ...
Read more >
How to build a Telegram OCR bot - LogRocket Blog
step2.command('cancel', (ctx) => { ctx.reply('Bye bye') return ctx.scene.leave() }) const imageScene = new WizardScene('imageScene', ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found