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.

Some problems with scenes

See original GitHub issue

I am using scenes like what is in the tutorial. My problem is that for example in function command I want to do this:

greeterBlue.command('red', async (ctx) => {
    ctx.reply("Hi")
    ctx.scene.leave()
    ctx.scene.enter('greeter-red')
})

But it seems that just the first line of the function executes. How can I write this to execute all three lines?

Thanks for any help.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

9reactions
eonicumcommented, Jan 9, 2018

Just add await for each line inside the function: greeterBlue.command('red', async (ctx) => { await ctx.reply("Hi") await ctx.scene.leave() awiat ctx.scene.enter('greeter-red') })

4reactions
Piterdencommented, Jan 18, 2018

ctx.scene.leave() makes current ctx.scene inactive, isn’t it?

greeterBlue.command('red', ({ reply, scene, stage }) => {
    reply('Hi')
    scene.leave()
    stage.enter('greeter-red')
})

You should use static method of the Stage class, IMHO

UPD: fixed!

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Common Scene Struggles and How to Fix Them - Stage 32
2. Unnatural Dialogue · 1. Small Talk · 2. Inauthentic Expression · 3. Carbon-Copy Voice.
Read more >
Common Problems with Scenes - GoGuardian
One or more students are being blocked by an unknown Scene or another teacher's Scene. · My Scene is not being applied to...
Read more >
8 Ways to Troubleshoot a Scene-and 5 Ways Make It Fabulous
4. The Scene Lacks a Resolution ... To truly move the plot, every scene must be cohesive unit unto itself. It must have...
Read more >
SCENE 25: 10 Scene Problems Solved - Darcy Pattison
Solve pesky scene problems: loss of focus, inadvertent interruptions, phony disasters, and more.
Read more >
10 Solutions To 10 Common On-Set Problems | Stareable Blog
SOLUTION: Restructure the day so that the person or persons who have to leave early do all their scenes first. Sometimes, this will...
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